Create, delete and rename groups
Top  Previous  Next


This example uses SamAccount commands and works on all Windows server versions - from NT 3.51 up to 2003. However, for Windows 2000 or 2003 you might want to use AD commands instead, see the
example Basic user and group management with AD commands.

[Settings_Begin]
BatchSettings.Delimiter=TAB
BatchSettings.MarkerCol=4
[Settings_End]

[Machines_Begin]
\\EDU12      NT PDC    
[Machines_End]

[Batch_Begin]
Data.Loop   
 Group.Global.Create %col1%   
 Group.SetProperty Global,%col1%,Description,%col3%   
 Group.SetProperty Global,%col1%,Name,%col2%
Data.Endloop   
[Batch_End]

[Undo_Batch_Begin]
Data.Loop   
 Group.Delete Global,%col2%
Data.Endloop   
[Undo_Batch_End]

[Data_Begin]
oldgroupname   newgroupname   newcomment   
oldgroupname2   newgroupname2   newcomment2   
[Data_End]

Batch section

·Create global group "oldgroupname"  
·Set description for group "oldgroupname" to "newcomment"  
·Rename group "oldgroupname" to "newgroupname"  
·Create global group "oldgroupname2"  
·Set description for group "oldgroupname2" to "newcomment2"  
·Rename group "oldgroupname2" to "newgroupname2"  

Undo section

·Delete global groups "newgroupname" and "newgroupname2"