Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $First = Read-Host -Prompt 'Input your first name'
- $Last = Read-Host -Prompt 'Input the user last name'
- $Fullname = $First + " " + $Last
- $Acn = Read-Host -Prompt 'First Initial Last Name please'
- $Group = Read-Host -Prompt 'Group in question'
- $Pass = Read-Host -Prompt 'Pass'
- ***secrets
- $SecretOU = SecretCompany
- $SecretDC = domain
- 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