Jump to content
Sign in to follow this  
ShawnW

Account creation, I'm sure this worked before but not anymore.

Recommended Posts

ShawnW

I know there are threads out there for creating local accounts with similar steps and I've used them successfully in the past. When it failed now though I stripped it down to what I assume is the minimum without adding properties or passwords, but still fails and I cannot figure out why.

$oSys = ObjGet("WinNT://" & @ComputerName)
$oUser = $oSys.Create("user", "tester")
$oUser.SetInfo

It fails when autoit thinks SetInfo is a method of the object.

 ==> The requested action with this object has failed.:
$oUser.SetInfo
$oUser^ ERROR

Anyway, I'm using windows 10. Any ideas are appreciated.

Share this post


Link to post
Share on other sites
JLogan3o13

You are not setting a password, nor (based on what you posted) are you running as Admin. This works just fine for me on Win10:

#RequireAdmin

$oSys = ObjGet("WinNT://" & @ComputerName & "")
$oUser = $oSys.Create("user", "Jimmy")
$oUser.SetPassword("Password1!")
$oUser.SetInfo

 


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
ShawnW

Ah thanks, scite wasn't running with admin apparently and I wasn't actually building the exe to test. I did have setpassword before but took it out when trying to find where they error was coming from.

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  

×