Link to home
Start Free TrialLog in
Avatar of Network_Padawan
Network_Padawan

asked on

Exception calling "SetInfo" with "0" argument(s):

I am trying to create a simple user account with vbscripting, yet I can not because of the following error. Can someone pls show me why the error occurs with Setinfo()?

$objUser=[ADSI]"LDAP://OU=People,DC=pit,DC=com,DC=au"
$objUser=$objOU.Create("user","CN=Scott Mitchell")
$objUser.Put("sAMAccountName","Scott Mitchell")
$objUser.SetInfo()

PS C:\Users\Administrator\Documents> .\newusers.ps1
Exception calling "SetInfo" with "0" argument(s): "There is a naming violation. (Exception from HR
At C:\Users\Administrator\Documents\Newusers.ps1:4 char:17
+ $objUser.SetInfo( <<<< )
Avatar of GundogTrainer
GundogTrainer

Can you confirm you have:
1. Sufficient permissions to create account in that OU.
2. The Samaccountname and user are unique and have not already been created.
ASKER CERTIFIED SOLUTION
Avatar of GundogTrainer
GundogTrainer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Network_Padawan

ASKER

Doh! Can't believe I missed that.

Thanks