Link to home
Start Free TrialLog in
Avatar of b_zajac
b_zajacFlag for United States of America

asked on

Creating Users in AD DS using Power Shell

PS C:\Users\Administrator> $objOU=[ADSI]("LDAP://OU=Peopel,DC=contoso,DC=com")

PS C:\Users\Administrator> $objUser=$objOU.Create("User","CN=Mary North")

The following exception occurred while retrieving member "Create": "There is no such object on the server.

"

At line:1 char:10

+ $objUser= <<<< $objOU.Create("User","CN=Mary North")

    + CategoryInfo          : NotSpecified: (:) [], ExtendedTypeSystemException

    + FullyQualifiedErrorId : CatchFromBaseGetMember

 

 

I guess the question is what am i doing wrong? I know that is vague but i don't know how else to ask it. You can view the full text that i need to enter below in order to complete my assignment. Thanks for any help in advance.

 

$objOU=[ADSI]("LDAP://OU=Peopel,DC=contoso,DC=com")

$objUser=$objOU.Create("User","CN=Mary North")

$objUser.Put("sAMAccountName","mary.north")

$objUser.SetInfo()

 

Regards,

B. Zajac
ASKER CERTIFIED SOLUTION
Avatar of chrismerritt
chrismerritt

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
SOLUTION
Avatar of Sajid Shaik M
Sajid Shaik M
Flag of Saudi Arabia image

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 b_zajac

ASKER

So the second link in shaiksaj's answer was a link to the question i posted in technet and apparently i did not know how to spell people correct and there for the error. The script chris merit works well and because everything is spelled correctly did return any errors. Any way thanks for the help.