Created
June 5, 2017 13:36
-
-
Save g3rhard/a92f6a053ce6d2fde0e82d813c291c88 to your computer and use it in GitHub Desktop.
Добавление пользователей Active Directory средствами PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-CSV -delimiter "," c:\Temp\users.csv | foreach { | |
New-ADUser -SamAccountName $_.SamAccountName -GivenName $_.GivenName -Surname $_.Surname -Name $_.Name ` | |
-Path "DC=domain,DC=local" ` | |
-AccountPassword (ConvertTo-SecureString -AsPlainText $_.Password -Force) -Enabled $true -PasswordNeverExpires $true -Description $_.description -DisplayName $_.DisplayName -userPrincipalName $_.userPrincipalName | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment