Assuming you have a text file (e.g. C:\ADGroups.txt) containing multiple Active Directory (AD) Groups with one AD group per line, you may use an MS-DOS script similar to the following to create all those AD Groups in your Active Directory domain.
for /F "tokens=* delims= " %%G in (C:\ADGroups.txt) do ( dsadd group CN="%%G",OU="Human Resources",OU="IT",DC=MYAD,DC=CYBERGAV,DC=IN )
NOTE:
(1) If you are typing the script above at the MS-DOS command prompt, then replace %%G by %G.
(2) The “for” statement above, ensures that AD Groups containing blankspaces are read correctly.
(Visited 697 times, 1 visits today)