PowerShell Help Add User

Ryck

Limp Gawd
Joined
Mar 7, 2003
Messages
331
Okay I am trying to add a user through PowerShell. Call it a learning experience, as I know how to do it through ADAC.

This is the script I am trying to use, but I keep getting errors.

$secpass = Read-Host "Password" -AsSecureString
New-ADUser -Name "User Name" -SamAccountName Uname
-UserPrincipalName "Unamen@test.com" -AccountPassword $secpass
-Path "cn=Users,dc=Test,dc=com" -Enabled:$true

Any help would be greatly appreciated.
 

socK

2[H]4U
Joined
Jan 25, 2004
Messages
3,914
Don't guess or make us guess. Post the error, it's literal purpose is to help you figure out what's wrong.

Do you actually have permissions to create the user? PowerShell will try under whatever user you're logged in as unless you specify the Credential parameter.
 
Top