Untitled
TssrNetro
plain_text
7 days ago
639 B
2
Indexable
# Importer le module Active Directory Import-Module ActiveDirectory # Définir le chemin LDAP du domaine $domainPath = "DC=ComputeSys,DC=lan" # Créer l'UO principale "SIEGE" New-ADOrganizationalUnit -Name "SIEGE" -Path $domainPath # Définir le chemin de l'UO "SIEGE" $siegePath = "OU=SIEGE,$domainPath" # Liste des sous-UOs à créer $subOUs = @("DIRECTION", "COMMERCIEUX", "COMPTABILITE", "ADMINISTRATEUR", "SUPPORT-01", "SUPPORT-02") # Création des sous-UOs foreach ($ou in $subOUs) { New-ADOrganizationalUnit -Name $ou -Path $siegePath } Write-Host "Les UOs ont été créées avec succès dans le domaine ComputeSys.lan."
Editor is loading...
Leave a Comment