A voir également:
- Récupération des noms de groupe active directory
- Comment créer un groupe whatsapp - Guide
- Les noms des animaux - Télécharger - Études & Formations
- Directory list & print - Télécharger - Divers Utilitaires
- Sous groupe whatsapp - Accueil - WhatsApp
- Convertisseur récupération de texte - Guide
1 réponse
voici le script que j'ai écris:
Import-Module ActiveDirectory
Import-Module 'Microsoft.PowerShell.Security'
$users = Import-Csv -Delimiter ";" -Path "C:\add\import.csv"
|--------------Création de groupe--------------|
New-ADGroup -Name Test1 -GroupScope Global -GroupCategory Security -Path "ou=Groups,dc=International,dc=HRC, dc=CORP"
New-ADGroup -Name Test2 -GroupScope Global -GroupCategory Security -Path "ou=Groups,dc=International,dc=HRC, dc=CORP"
New-ADGroup -Name Test3 -GroupScope Global -GroupCategory Security -Path "ou=Groups,dc=International,dc=HRC, dc=CORP"
New-ADGroup -Name Test4 -GroupScope Global -GroupCategory Security -Path "ou=Groups,dc=International,dc=HRC, dc=CORP"
--------------Formatage des noms--------------
get-adgroup -filter * -searchbase ‘OU=Groups, OU=international, DC=HRC, DC=CORP’ | %{$newname = “GG-PLU-” + $_.name.split (“-“,4)[3]; $_ | set-adgroup -samaccountname $newname; $_ | rename-adobject -newname $newname}
Import-Module ActiveDirectory
Import-Module 'Microsoft.PowerShell.Security'
$users = Import-Csv -Delimiter ";" -Path "C:\add\import.csv"
|--------------Création de groupe--------------|
New-ADGroup -Name Test1 -GroupScope Global -GroupCategory Security -Path "ou=Groups,dc=International,dc=HRC, dc=CORP"
New-ADGroup -Name Test2 -GroupScope Global -GroupCategory Security -Path "ou=Groups,dc=International,dc=HRC, dc=CORP"
New-ADGroup -Name Test3 -GroupScope Global -GroupCategory Security -Path "ou=Groups,dc=International,dc=HRC, dc=CORP"
New-ADGroup -Name Test4 -GroupScope Global -GroupCategory Security -Path "ou=Groups,dc=International,dc=HRC, dc=CORP"
--------------Formatage des noms--------------
get-adgroup -filter * -searchbase ‘OU=Groups, OU=international, DC=HRC, DC=CORP’ | %{$newname = “GG-PLU-” + $_.name.split (“-“,4)[3]; $_ | set-adgroup -samaccountname $newname; $_ | rename-adobject -newname $newname}