Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

new-aduser error

$
0
0

Hi

i wanted to create a script that will help me save time when i create a new user
the script is a one-liner and goes like that :
New-ADUser -Name (Read-Host “Name”) -GivenName (Read-Host “GivenName”) -Surname (Read-Host “SureName”) -SamAccountName (Read-Host “SamAccountName”) -Path (Read-Host “Path”) -Enabled $true -AccountExpirationDate $null -AccountPassword (Read-Host -AsSecureString “AccountPassword”)

when i run it and put all the parameters i get an error : “New-ADUser : The object name has bad syntax”

what am i doing wrong?

Thanks


Viewing all articles
Browse latest Browse all 13067

Trending Articles