1. To create multiple groups in active directory we need three inputs.
1. Group name
2. OU path (Distinguished name)
3. Group Type
2. Make sure you are separating all the inputs with semicolon (;)
a. Example:
Group name1;OU path;group type
Group name2;OU path;group type
3. Save the file in c:\temp or in any other location.
#----------------------------------------------------------------
foreach($line in Get-Content "C:\Temp\groups.txt")
{
$info = $line -split ";"
$group = $info[0]
$oupath = $info[1]
$grouptype = $info[3]
new-ADGroup -Name $group -Path $oupath -GroupScope $grouptype
}
#=========================================================================
On this page of the site you can watch the video online Powershell to create multiple groups in Active directory with a duration of hours minute second in good quality, which was uploaded by the user Abhijit Bole 28 December 2016, share the link with friends and acquaintances, this video has already been watched 6,655 times on youtube and it was liked by 38 viewers. Enjoy your viewing!