wmi script adds LOCAL user need Local Admin

  • Thread starter Thread starter Al
  • Start date Start date
A

Al

I was looking all day for a script that would add a user
to a LOCAL machine. I finally found one! The only problem
is that I need to create the user in the "Administrators
Group" I edited the script over 100 time and could not
find any documentation on what class to call or anything.

Here is the script:
************
strComputer = "."
Set colAccounts = GetObject("WinNT://" & strComputer
& ",computer")
Set objUser = colAccounts.Create("user", "Admin2")
objUser.SetPassword "sA2xpWh"
objUser.SetInfo
**************

seems simple enough>>

Can anyone help???
 
microsoft.public.win2000.security news group, Al
I was looking all day for a script that would add a user
to a LOCAL machine. I finally found one! The only problem
is that I need to create the user in the "Administrators
Group" I edited the script over 100 time and could not
find any documentation on what class to call or anything.

Does it need to be a WMI script? Why not just use "net user" and "net
group"?
 
Back
Top