Guest User

Untitled

a guest
Jun 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. $First = Read-Host -Prompt 'Input your first name'
  2. $Last = Read-Host -Prompt 'Input the user last name'
  3. $Fullname = $First + " " + $Last
  4. $Acn = Read-Host -Prompt 'First Initial Last Name please'
  5. $Group = Read-Host -Prompt 'Group in question'
  6. $Pass = Read-Host -Prompt 'Pass'
  7. ***secrets
  8. $SecretOU = SecretCompany
  9. $SecretDC = domain
  10.  
  11. New-ADUser -Name $Fullname -DisplayName $Fullname -GivenName $First -Surname $Last -Path "OU=Staff,OU=$SecretOU,DC=ny,DC=$SecretDC,DC=com" -sAMAccountName $Acn -UserPrincipalName "$Acn@.$SecretDC.com" -Enabled $True -PasswordNeverExpires $true -CannotChangePassword $true -AccountPassword (ConvertTo-SecureString -AsPlainText -Force -String $Pass)
Add Comment
Please, Sign In to add comment