waltforbes
asked on
How do I script bulk creation of AD groups?
Points of My Scenario:
1. I am admin of a Windows Server 2003 domain
2. I need to create 96 (ninety-six) domain local groups
3. I have a text file containing the group names - one group per line
QUESTION: How can I script the creation of these 96 groups into an OU, using the text file?
1. I am admin of a Windows Server 2003 domain
2. I need to create 96 (ninety-six) domain local groups
3. I have a text file containing the group names - one group per line
QUESTION: How can I script the creation of these 96 groups into an OU, using the text file?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi, if you wish ti try other methods, like Quest PowerShell module for AD or Microsoft DS Tools, please let me know. I would help you then. If not, follow with Rob's syntax :)
Regards,
Krzysztof
Regards,
Krzysztof
ASKER
To Rob: please note the following error I receive:
C:\Scripts\Create_Groups_f rom_File.v bs(19, 2) Microsoft VBScript runtime error:
Object required: 'objOU'
To iSiek: I am interesed in Quest PowerShell module for AD.
C:\Scripts\Create_Groups_f
Object required: 'objOU'
To iSiek: I am interesed in Quest PowerShell module for AD.
OK, so try this syntax
Get-Content c:\groups.txt | %{ New-QADGroup -name "$_" -ParentContainer "ou=GroupLocation,dc=domai n,dc=local " -DisplayName "$_" -GroupType "Security" -GroupScope "DomainLocal" -SamAccountName "$_"
Krzysztof
Get-Content c:\groups.txt | %{ New-QADGroup -name "$_" -ParentContainer "ou=GroupLocation,dc=domai
Krzysztof
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm so happy!
Regards,
Rob.
Open in new window