Created
June 8, 2018 23:05
-
-
Save nshores/a1452354449b5e9a805b0d4d08648f0e to your computer and use it in GitHub Desktop.
new_ad_user.ps1
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
$content = Import-Csv 'c:\test.csv' | |
foreach ($user in $content){ | |
New-ADUser -Enabled $True -AccountPassword (ConvertTo-SecureString aiwhc321 -AsPlainText -force) -name $user."Display Name" ` | |
-homeDirectory $user."Home Directory" ` | |
-homedrive $user."Home Drive" ` | |
-scriptPath $user."Script Path" ` | |
-SamAccountName $user."SAM Account Name" ` | |
-path $user."OU Name" | |
#Path needs to be full LDAP DN path - "OU=students, DC=pel, DC=com" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment