wmi script adds LOCAL user need Local Admin

From: Al (anonymous_at_discussions.microsoft.com)
Date: 03/18/04


Date: Wed, 17 Mar 2004 20:38:19 -0800

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



Relevant Pages

  • Re: How to call a remote program through SSH tunnel and pass a local file as parameter?
    ... If I would have the program on the local machine I could call this ... Many people seem to think that rsa keys must be created ... Some sophistications to this script include the ability to use something ... like %f to include the file in your command line. ...
    (comp.security.ssh)
  • Re: Startup Scripts
    ... "Trinity Catholic High School" wrote: ... local machine, and setting in the group policy the local path for the ... I run the script from the command-line when logged in it works ... If there is a permissions problem, the permissions need to be granted to the ...
    (microsoft.public.windows.server.general)
  • Re: Copying Files / Created Date
    ... > than the a version on the machine from which the script is run. ... > If the file on the server was created more recently than the one on ... > the local machine, it replaces the the file on the local machine with ... That's Windows at work;-)... ...
    (microsoft.public.scripting.wsh)
  • Re: Classic ol "Automation server Cant create object"
    ... >> using the script provided on the page to disable the local machine ... Disabling the local machine lockdown just lets active content (client ... will be in the local computer zone if accessed from a local hard drive. ...
    (microsoft.public.scripting.jscript)
  • Re: ScriptText - ActiveScriptEventConsumer - Create
    ... And this machine is local machine that is where you launch the script also. ... > Dim objInstOfEventFilter ...
    (microsoft.public.win32.programmer.wmi)