How would I remove an account from the Power Users group with a vbs script?

And then create a local account and set a password then
add the new account to the Power Users group.

I need to be able to do this on 300+ systems.

Thanks.

Re: Removeing a local account from the Power Users group by Ray

Ray
Fri Feb 27 11:41:51 CST 2004

I apologize for not giving you a vbs answer. For some things, I believe
that good old shell scripting would be preferred.

(logon.bat)
NET USER NewUserAccount ThePassword /ADD
NET LOCALGROUP "Power Users" NewUserAccount /ADD
NET LOCALGROUP "Power Users" TheOldAccount /DELETE

Ray at work


"James Sheibal" <j> wrote in message
news:ehgzqeV$DHA.3712@tk2msftngp13.phx.gbl...
> How would I remove an account from the Power Users group with a vbs
script?
>
> And then create a local account and set a password then
> add the new account to the Power Users group.
>
> I need to be able to do this on 300+ systems.
>
> Thanks.
>
>
>



Re: Removeing a local account from the Power Users group by Torgeir

Torgeir
Fri Feb 27 12:02:45 CST 2004

James Sheibal wrote:

> How would I remove an account from the Power Users group with a vbs script?

Some examples:

http://groups.google.com/groups?selm=u4EbY9nzDHA.2412%40TK2MSFTNGP10.phx.gbl

http://groups.google.com/groups?selm=401E7AA1.5D2EEE71%40hydro.com

http://groups.google.com/groups?selm=3E530599.8EF9AA2C%40hydro.com


> And then create a local account and set a password then
> add the new account to the Power Users group.

Some examples:

http://groups.google.com/groups?selm=400C7510.EA93FE93%40hydro.com

http://groups.google.com/groups?selm=400D9FB5.FB0F7F88%40hydro.com


> I need to be able to do this on 300+ systems.

The scripts in the links above can be run against remote computers,
or they can be run locally.


For local runs:

If the users are local admins, the code below could be e.g. put
in a logon script.

If you have Active Directory, you could do it in a computer startup
script (with a GPO) that runs as part of the boot up process (before
the user logs in). It runs under the system context and has admin rights.

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter