Jump to content
Sign in to follow this  
L'egyptien

Another Noob's question ...

Recommended Posts

L'egyptien

Hello,

Sorry to disturb you with my (easy for u, I hope) problem.

I just don't know how create a local user on my computer (windows XP). I try many possibilities, without succes ...

Let's just take a look on my script and please don't laught !!!!

$Domain = ObjGet("Winnt://" & @ComputerName)

$ObjUser = $Domain.Create ("User",$Login)

$ObjUser.SetPassword $mdp

$ObjUser.SetInfo

I try with LDAP://, and with other syntaxe, but no one work ... please help the noob I am !!!!

Share this post


Link to post
Share on other sites
PsaltyDS

$Domain = ObjGet("Winnt://" & @ComputerName)

$ObjUser = $Domain.Create ("User",$Login)

$ObjUser.SetPassword $mdp

$ObjUser.SetInfo

The parameter belongs inside parens:

$ObjUser.SetPassword ($mdp)

Other than that, it should work. What, exactly, doesn't?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
L'egyptien

Thanks to reply me !!! :)

But this is the 2nd line who doesn't works ..

this say to me :

==> Variable must be of type "Object".:

$ObjUser = $Domain.Create ("User",$Login)

$ObjUser = $Domain^ ERROR

Share this post


Link to post
Share on other sites
PsaltyDS

Thanks to reply me !!! :)

But this is the 2nd line who doesn't works ..

this say to me :

==> Variable must be of type "Object".:

$ObjUser = $Domain.Create ("User",$Login)

$ObjUser = $Domain^ ERROR

$Domain is not an object because your attempted connection to the WINNT:// interface failed. Most likely because of insufficient rights, but you can add a COM error handler to tell you more. Look in the help file under OBJ/COM reference.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
L'egyptien

$Domain is not an object because your attempted connection to the WINNT:// interface failed. Most likely because of insufficient rights, but you can add a COM error handler to tell you more. Look in the help file under OBJ/COM reference.

:)

Still Thanks,

I will search in the help file ..... Just the thing I think it strange is the WinNT:// into the code, when you know that my computer turn with Windows XP ....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×