PS AD – Erstelle OU in OUs

# Erstelle OU in OUS

$ous = @(("IT_Entwicklung","Essen"),("IT_Test","Bochum"))
 foreach($ou in $ous)
 {
 $newou = New-ADOrganizationalUnit -Name $ou[0] -Path "OU=ORG,DC=ndsedv,DC=de" -Description $ou[1] -ProtectedFromAccidentalDeletion $false -PassThru
 $ouGroups=New-ADOrganizationalUnit -Name "Gruppen" -Path $newou.DistinguishedName `
 -Description "Gruppen" `
 -ProtectedFromAccidentalDeletion $false -PassThru }

Create OUs and Groups

Download Skript:

OU in OUs erstellen