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
}
#=========================================================================
Powershell to create multiple groups in Active directory
Теги
Powershell to create multiple groups in Active directorypowershell add multiple groups quicklypowershell for active directoryusers an groupsactive directory users and groupspowershell and ad groupscreate bulk groupspowershell to create groups in adpowershell script to create groupspowershell to create distribution groupspowershell create groups in active directorypowershell create groups in active directory from csvpowershell create groups from list