Re: Adding Domain Admins to local computer administrator groups
From: Freddy Hartono (freddy_hartono_at_nonospam.non.agilent.com)
Date: 05/05/04
- Next message: Freddy Hartono: "Re: SYSTEM UPTIME"
- Previous message: Torgeir Bakken \(MVP\): "Re: Needing some Help"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 4 May 2004 21:21:34 -0700
Create a machine startup GPO (machine startup will be run
as SYSTEM context)
create a .bat file put into the correct folder
net localgroup administrators domain\username /add
Or if you want to get fancy (slower i believe) run this
http://support.microsoft.com/default.aspx?scid=kb;en-
us;555026
>-----Original Message-----
>Chris wrote:
>
>> I am trying to add a new domains Domain Admin group
into the local
>adminstrators group on all the workstations in another
domain, can this be
>done via a script and if so can I get a copy of the
script please.
>
>Hi,
>
>I have used a script similar to below for this purpose:
>
>' Specify AdsPath of domain group to be added to
>' local Administrators group.
>strDomainGroup = "WinNT://MyDomain/NewGroup,group"
>
>Set objDomainGroup = GetObject(strDomainGroup)
>Wscript.Echo objDomainGroup.AdsPath
>
>' Retrieve local computer NetBIOS name.
>Set objNetwork = CreateObject("Wscript.Network")
>strComputer = objNetwork.ComputerName
>
>' Bind to local Administrators group.
>Set objLocalGroup = GetObject("WinNT://" & strComputer _
> & "/Administrators,group")
>
>' Check if domain group already a member.
>If Not objLocalGroup.IsMember(objDomainGroup.AdsPath) Then
> ' Add domain group to local group.
>' objLocalGroup.Add(objDomainGroup.AdsPath)
> Wscript.Echo "Not Member, add"
>Else
> Wscript.Echo "Already member"
>End If
>
>Note that users generally do not have sufficient
permissions to add members
>to the local administrators group, so this cannot be done
in a logon script.
>Assuming all client are W2k or above, you can do this in
a Startup script,
>using Group Policy. Startup scriptss run with System
privileges on the local
>machine and can add members to this group. However, I
have never added a
>group from one domain to a local group on a computer in
another domain.
>Success probably depends on the trust relationship, or
you may have to
>supply credentials (which is a security concern).
>
>--
>Richard
>Microsoft MVP Scripting and ADSI
>HilltopLab web site - http://www.rlmueller.net
>--
>
>
>.
>
- Next message: Freddy Hartono: "Re: SYSTEM UPTIME"
- Previous message: Torgeir Bakken \(MVP\): "Re: Needing some Help"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|