T
timgerrlists
I have been playing with ruby for a few weeks now to do windows
administration. I haved used ruby with WMI on harder scripts but cant
figure out what to do here. I want to query remote computers and see
who is in the administratiors group.
require 'win32ole'
cpuName = '127.0.0.1'
mgmt = WIN32OLE.connect("WinNT://#{cpuName}/Administrators,group")
mgmt.InstancesOf("Members").each{|person| puts person.Name} <---- This
fails
The last line fails because I am not sure how to structure it. Here is
the equivelent VBscript
Set objGroup = GetObject("WinNT://" & strComputer &
"/Administrators,group")
For Each mem In objGroup.Members
WScript.echo vbTab & Right(mem.adsPath,Len(mem.adsPath) -
8)
I thank any help.
administration. I haved used ruby with WMI on harder scripts but cant
figure out what to do here. I want to query remote computers and see
who is in the administratiors group.
require 'win32ole'
cpuName = '127.0.0.1'
mgmt = WIN32OLE.connect("WinNT://#{cpuName}/Administrators,group")
mgmt.InstancesOf("Members").each{|person| puts person.Name} <---- This
fails
The last line fails because I am not sure how to structure it. Here is
the equivelent VBscript
Set objGroup = GetObject("WinNT://" & strComputer &
"/Administrators,group")
For Each mem In objGroup.Members
WScript.echo vbTab & Right(mem.adsPath,Len(mem.adsPath) -
8)
I thank any help.