Page 1 of 1 1
Topic Options
#149104 - 2005-10-03 12:41 PM Add a domain global group to local admins group
willuk9999 Offline
Lurker

Registered: 2002-11-12
Posts: 4
Hi,

A while back I used a script that added nt4 domain global groups to the desktop local admin groups remotely - does anyone have a copy of this all

Thanks

Top
#149105 - 2005-10-03 02:14 PM Local Admin Group Membership Audit for Servers.
Mehmet Offline
Fresh Scripter

Registered: 2005-08-12
Posts: 7
hi ,
I've number of Servers globally ( 80 ) All these are win2003 servers .And country responsibles are managing them individually .and I'm member of Admin Group of these Servers .

What I would like to achieve is to run Kix script on my Computer which will enable me to see Local Administrator Group of Each Server That I'll specifiy .
Problem comes at that phase , I'm not sure if it can be happen with Kix or not ?

thanks

Top
#149106 - 2005-10-03 07:13 PM Re: Add a domain global group to local admins group
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
Here's a little snippet that should get you started.

Code:

$admins = getobject('WinNT://TheRemoteMachine/Administrators')
$admins.Add('WinNT://TheDomain/TheAccount')


Top
#149107 - 2005-10-03 07:51 PM Re: Add a domain global group to local admins group
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Think the UDF sites have stuff for this.

Code:
Function AddToLocalAdmin($Computer,$GroupToAddTo,$Domain,optional $GroupToAdd,optional $AccountToAdd)
Dim $Group,$User,$Admin,$Err
$Group = GetObject('WinNT://' + $Computer + '/' + $GroupToAddTo + ',group')
If $GroupToAdd<>""
$User = GetObject('WinNT://' + $Domain + '/' + $GroupToAdd + ',group')
EndIf
If $AccountToAdd<>""
$User = GetObject('WinNT://' + $Domain + '/' + $AccountToAdd + ',user')
EndIf
$Group.Add($User.ADsPath)
$Err = @ERROR
$AddToLocalAdmin=$Err
EndFunction


Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1574 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.066 seconds in which 0.036 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org