Here's what I used to push out groups - uses would be similar. You need a copy of PSExec.exe for this, or modifiy it to use some WMI-based remote exec process.


; Glenn Barnas - 10/7/03 
; Adds local groups on a remote machine, based on entries from a file 
 
$ = SetOption('WrapAtEOL', 'On')
 
Break On
 
Global $DEBUG
 
Dim $SFile, $CFile, $Group, $Cmd, $Tmp
 
 
;========================================== 
; Must be ZERO to function! 
$DEBUG = 0
;========================================== 
 
; Define vars 
$SFile = '.\servers.txt'
$CFile = '.\GrpMgmt.ini'
 
; Read the LocalGroups list from the INI file & create an array 
$Tmp = ReadProfileString($CFile, 'Common', 'LocalGroups')
If $Tmp = ''
  'No local groups defined - aborting!' ? ?
  Quit
EndIf
$LocalGroups = Split($Tmp, ',')
 
; Process each server name in the source file 
If Open(5, $SFile, 2) = 0
  $Server = ReadLine(5)
  While @ERROR = 0
    If $Server <> ''			; make sure server is specified 
      ; Process each local group 
      For Each $Group in $LocalGroups
        $Group = Trim($Group)
        $Target = '\\' + $Server
 
        ; Should we create the local group? 
        $Tmp = ReadProfileString($CFile, $Group, 'MakeLocal')
        If $Tmp <> 'N'
          DoCmd('%ComSpec% /c psexec ' + $Target + ' Net LocalGroup /Add "' + $Group + '">>groupadd.log')
        EndIf
 
        ; Process a list of groups to add to this Local group 
        $Tmp = ReadProfileString($CFile, $Group, 'AddAccounts')
        If $Tmp = ''
          'No accounts defined to add to $Group!' ? ?
        EndIf
        $AddAccounts = Split($Tmp, ',')
 
        For Each $AddAcct in $AddAccounts 
          $AddAcct = Trim($AddAcct)
          DoCmd('%ComSpec% /c psexec ' + $Target + ' Net LocalGroup "' + $Group + '" /add "' + $AddAcct 
            + '">>groupadd.log')
        Next
 
      Next
 
    EndIf
    $Server = ReadLine(5)
  Loop
Else
  'Error opening file: @SERROR' ?
EndIf
 
$RC = Close(5)
 
 
Function DoCmd($fCmd)
 
  If $DEBUG
    $fCmd ?
  Else
    Shell $fCmd
  EndIf
 
EndFunction
 
 

Here's the sample GrpMgmt.ini file

[COMMON]
# LocalGroups = comma-separated list of groups to update
LocalGroups=Administrators

# for each group defined in LocalGroups, a corresponding section is needed
[Administrators]
# MakeLocal=Y/N - should the local group be created?  
MakeLocal=N
# AddAccounts= comma-separated list of accounts to add to the defined local group
AddAccounts=DOMAIN\Security_Group

# DelAccounts= comma-separated list of accounts to remove from the defined local group
DelAccounts=

# [NewGroup]	Name of local group
# MakeLocal=Y	Create it? (Y/N)
# AddAccounts=Accounts,to,add
# DelAccounts=Accounts,to,delete

The "servers.txt" file is just a plain list of computers to process, one host per line.

As you can see, this is pretty old code, but it works.

Glenn

_________________________
Actually I am a Rocket Scientist! \:D