Thanks for the responses Guys
What I am trying to do is run a script that reaches out to each machine listed in clist.dat (all in my domain), and create a LocalGroup. Then Add a certain DomainGroup to that LocalGroup. I used Michael's code snippet, but don't know enough about ADSI to know if I am doing this right.I have Tried and tried, but get the same error:
Script error : unknown command !
$Group=$Computer.Create("group",$LocalGrp)
Here is the code:
code:
$ComputerName = ReadLine(1)
?"Enter Local Group to create on each Machine: " Gets $LocalGrp;********* Do Stuff to each Machine in list ***********
Do
;Create Group
$Computer=GetObject("WinNT://$Domain/$ComputerName,computer") ;Replace the computername with $CompuerName from clist.dat
;Info For Testing
?"Machine: " + $ComputerName
?"New group: " + $LocalGrp
?""
$Group=$Computer.Create("group",$LocalGrp)
$Group.Put("grouptype",4) ;2=global(in domain) and 4=local
;Add Users
$Group.add("WinNT://$Domain/CSUP-Local")
$Group.setinfo
;show group members
For Each $e in $oGroup.members
? $e.name
Next
I hope this comes out right, it is my first time attempting to post code to this board.
Mike