add user to local win2k administrator group 
Author Message
 add user to local win2k administrator group

How can I add a user account to the local administrator group on each
workstation?

Thanks

Rolf



Sun, 27 Feb 2005 20:50:07 GMT  
 add user to local win2k administrator group

Quote:

> How can I add a user account to the local administrator group on each
> workstation?

=================================================
VBScript/ADSI:

sUser = "mini-strator"
sGroupname = "Administrators"

Set oWshNet = CreateObject("WScript.Network")
sComputerName = oWshNet.ComputerName

Set oUser = GetObject("WinNT://" & sComputerName & "/" & sUser)

' Add the user to the group
Set oGroup = GetObject("WinNT://" & sComputerName & "/" & sGroupname)

' Use error handling in case the user is a member already
On Error Resume Next
oGroup.Add(oUser.ADsPath)
On Error Goto 0

=================================================
Command line based:

To add users/groups to the local groups, you can use cusrmgr from the reskit or
Lg.exe from free win32 tools page of http://www.joeware.net


Subject: net localgroup on remote workstation
Newsgroups: microsoft.public.win2000.cmdprompt.admin
Date: 2002-08-02 09:00:51 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=b078f1...

--
torgeir



Sun, 27 Feb 2005 22:13:35 GMT  
 add user to local win2k administrator group
Thanks! One more question, unfortunately we have still different OS
languages deployed and therefore the local admininstrators group name is not
equal in English, French, German, etc.. Is there an enviroment variable I
can use or do I have to read the information out of the registry?

Rolf



Quote:

> > How can I add a user account to the local administrator group on each
> > workstation?

> =================================================
> VBScript/ADSI:

> sUser = "mini-strator"
> sGroupname = "Administrators"

> Set oWshNet = CreateObject("WScript.Network")
> sComputerName = oWshNet.ComputerName

> Set oUser = GetObject("WinNT://" & sComputerName & "/" & sUser)

> ' Add the user to the group
> Set oGroup = GetObject("WinNT://" & sComputerName & "/" & sGroupname)

> ' Use error handling in case the user is a member already
> On Error Resume Next
> oGroup.Add(oUser.ADsPath)
> On Error Goto 0

> =================================================
> Command line based:

> To add users/groups to the local groups, you can use cusrmgr from the
reskit or
> Lg.exe from free win32 tools page of http://www.joeware.net


> Subject: net localgroup on remote workstation
> Newsgroups: microsoft.public.win2000.cmdprompt.admin
> Date: 2002-08-02 09:00:51 PST

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=b078f1...
7f4

- Show quoted text -

Quote:

> --
> torgeir



Mon, 28 Feb 2005 04:02:35 GMT  
 add user to local win2k administrator group
Hi,

I don't think there is an environment variable to get the string
representation of the Administrators group. You can, though, enumerate all
the groups to get the names of these groups.

Set oGrp = GetObject("WinNT://" & sComputerName)
oGrp.Filter = Array("group")
for each grp in oGrp
Wscript.Echo grp.Name
next

Not sure if this will help since I don't know how the French or German
operating systems names the Administrators group.

Regards,
Yan Liu
This posting is provided "AS IS" with no warranties, and confers no rights.



Mon, 28 Feb 2005 16:05:20 GMT  
 add user to local win2k administrator group
If you have deployed active directory, you can use group policy (restricted
groups) to add in domain users or groups.

Jonathan

Quote:
> How can I add a user account to the local administrator group on each
> workstation?

> Thanks

> Rolf



Tue, 01 Mar 2005 03:00:07 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. VB script: adding AD group to local administrators group

2. Adding domain groups to gthe local administrator group

3. Adding a domain group to local administrators group

4. Script that remotely moves local users from Administrators to Power Users group

5. Script that remotely moves local users from Administrators to Power Users group

6. How can I add a Domain Account to the Local Administrators Group

7. Adding multiple users or groups to local groups

8. Removing local Administrator account from Administrators group

9. Adding domain users to Local Administrators

10. How to add local user account to remote Win2K (not DC)

11. Add and remove AD user to and from local group

12. Add user to local W2kAS admin group?

 

 
Powered by phpBB® Forum Software