wmi script adds LOCAL user need Local Admin

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???
 
P

Paul Adare - MVP - Microsoft Virtual PC

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"?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top