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("us er","CN=Sc ott Mitchell")
$objUser.Put("sAMAccountNa me","Scott Mitchell")
$objUser.SetInfo()
PS C:\Users\Administrator\Doc uments> .\newusers.ps1
Exception calling "SetInfo" with "0" argument(s): "There is a naming violation. (Exception from HR
At C:\Users\Administrator\Doc uments\New users.ps1: 4 char:17
+ $objUser.SetInfo( <<<< )
$objUser=[ADSI]"LDAP://OU=
$objUser=$objOU.Create("us
$objUser.Put("sAMAccountNa
$objUser.SetInfo()
PS C:\Users\Administrator\Doc
Exception calling "SetInfo" with "0" argument(s): "There is a naming violation. (Exception from HR
At C:\Users\Administrator\Doc
+ $objUser.SetInfo( <<<< )
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Doh! Can't believe I missed that.
Thanks
Thanks
1. Sufficient permissions to create account in that OU.
2. The Samaccountname and user are unique and have not already been created.