Here is a quick little vbscript that will accomplish that. We used it to
remove a certain group and add a different group to the local administrators
group on 100+ servers. Edit it and test  to meet your needs. It reads a text
file with the server names in it called serverlist.txt, which you can change.
This worked on both W2K and NT4 (sp6a) servers.

'=====================================================
'| Remove global group from local group.             |
'| Add global group to local group.                  |
'=====================================================

Const ForReading = 1
Dim ServList
Dim fs,f,s,CompName
On Error Resume Next
set WshShell = CreateObject("WScript.Shell")
ServList = ""
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("serverlist.txt", ForReading, True)
Do While f.AtEndOfStream <> True
     CompName = f.ReadLine
     wshshell.popup "Computer Name: " & CompName,1
     ' Place the name of your domain here
     UsrDomainString = "yourdomain"
     ' This is the local member server group I want to add/remove the global
groups from
     LocalGrp1 = "Administrators"
     ' These are the global groups I am removing and adding from the server
local group
     GroupString1 = "globalgroup1"
     GroupString2 = "globalgroup2"
     Set GroupObj = GetObject("WinNT://" & CompName & "/" & LocalGrp1)
     ' Here we remove the first global group from the member server local
group
     GroupObj.Remove ("WinNT://" & UsrDomainString & "/" & GroupString1)
     ' Here we add the second global group to the member server local group
     GroupObj.Add ("WinNT://" & UsrDomainString & "/" & GroupString2)
     Set GroupObj = Nothing
     Servlist= Servlist & CompName & " " & vbCrLf
Loop
WScript.Echo ServList

Thanks


                                                                                       
                       
                    Andrew Baker                                                       
                       
                    <AndrewB@Revi        To:     "NT System Admin Issues"              
                       
                    ew.com>              <[EMAIL PROTECTED]>       
                       
                                         cc:                                           
                       
                    08/30/2001           Subject:     RE: Group Question               
                       
                    11:28 AM                                                           
                       
                    Please                                                             
                       
                    respond to                                                         
                       
                    "NT System                                                         
                       
                    Admin Issues"                                                      
                       
                                                                                       
                       
                                                                                       
                       




Use the FOR command along with CUSRMGR

Or, use one of the other tools like Hyena


See the following:
 http://www.ultratech-llc.com/KB/?File=UserMgr.TXT


- ASB

     -----Original Message-----
     From: Bob Chyka [mailto:[EMAIL PROTECTED]]
     Sent: Thursday, August 30, 2001 11:31 AM
     To: NT System Admin Issues
     Subject: Group Question

     Dos anyone know anyway to make a global group on our server (windows2000)
     a member of the local power users group on about 150 machines easily?

     any input is greatly appreciated..

     Bob Chyka
http://www.sunbelt-software.com/ntsysadmin_list_charter.htm




http://www.sunbelt-software.com/ntsysadmin_list_charter.htm

Reply via email to