Move all accounts that are member of a certain group to the same OU
Top  Previous  Next


This script moves all accounts that are member of the group "MyGroup" in the OU "MyOU" to the OU "NewOu".

[Settings_Begin]
BatchSettings.Delimiter=TAB
BatchSettings.MarkerCol=4
BatchSettings.MarkersAutoRemove=Yes
BatchSettings.LogToFile=3
SET ADDomainPath=dc=com/dc=acme/dc=D2
SET ADGroupPath=%ADDomainPath%/ou=MyOu/cn=MyGroup
SET ADOUPath=%col3%
SET ADNewOUPath=%ADDomainPath%/ou=NewOu
[Settings_End]

[Machines_Begin]
\\EDU8      NT PDC    
[Machines_End]

[Init_Batch_Begin]
Data.Get.AD Group,%ADGroupPath%, User, Yes, CN§1§ScriptPath§2§ADpath§3§   
Data.Show   
[Init_Batch_End]

[Batch_Begin]
Data.Loop   
 AD.OU.MoveObject %ADOUPath%, %ADNewOUPath%
Data.EndLoop   
[Batch_End]

[Data_Begin]
[Data_End]