Re: Registry Key

From: Torgeir Bakken (MVP) (Torgeir.Bakken-spam_at_hydro.com)
Date: 02/28/04


Date: Sat, 28 Feb 2004 03:28:30 +0100

Bob wrote:

> Where is the registry key for the administrators group. I
> would like to add a new group to the administrators group
> on each PC and would like to make a reg punch to do this.

Hi

Sorry, you can't do that with a registry edit.

net.exe can be used for this, something like this:

net.exe localgroup "local group name" "domain\domain group name" /add

(in a command prompt, run "net.exe help localgroup" for more information)

Alternatives for local as well as remote execution:

The free command line utility Lg.exe on the free win32 c++ tools page of
http://www.joeware.nen

VBScript using the WinNT provider is also an option:

http://groups.google.com/groups?q=ADsPath+winnt+GetObject+add+administrators+group:*.scripting

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


Relevant Pages

  • Re: Remove Users From Local Admin Group
    ... > local Admin group from the login script. ... Both local and domain users will be removed ... ' account from the Administrators group will fail. ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)
  • Re: Script for creating a new user
    ... I want to create a local user. ... Creating a local user and adding it to the Administrators group ... ' Use error handling in case the account is a member already ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)
  • Re: AD in Local Groups differente languajes?
    ... > the local Administrators group on every workstation, ... > have different languages on the workstation and the Administrators group ... To run this WMI query against NT4 computers, ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windows.server.scripting)
  • Re: Remove Users From Local Admin Group
    ... Below is a script that will remove all *user* accounts from the ... ' suppress errors, e.g. trying to remove the builtin Administrator ... ' account from the Administrators group will fail. ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)
  • Ownership Directory issue
    ... I tried to use takeown command through command prompt but I get Access denied. ... what is the exact command line which I need to run for administrators group ... Maybe I can't take ownership of that directory because I don't run properly ...
    (microsoft.public.windows.server.general)