I am working on providing a more robust and usable Win32Admin.DLL. The new compiler being used permits me to return an array of hashes. I have a working VBS script but can't get it work in KiXtart 4.20rc2.
I am looking for some more definitive answer if I am just a numbskull or if some COM enhancement should be requested.
There has been some confusion with the VBS script. You have to substitute a valid NT computer name in for "computername" or you will get an error (RPC Server is unavailable. at Win32Admin2.ctrl line 20).
Working VBS code:
code:
Set obj = CreateObject("Win32Admin2")
A = obj.GrpEnumMembers("computername", "local", obj.GetLocalAdminGrp())
For Each hash In A
For Each key In hash.keys()
MsgBox "Hash{" & key & "} = " & hash.get(key)
Next
Next
KiX code:
code:
break ON
$Win32Admin = createobject("Win32Admin2")
$Members = $Win32Admin.GrpEnumMembers(@wksta, "local", $Win32Admin.GetLocalAdminGrp())
for each $hash in $Members
for each $key in $hash.keys
? $key
next
next
I assume that "keys" method just doesn't work from KiXtart. Is there a way to get around this issue or should there be a request made for new functionality?
I can send the DLL to anyone that wants to test this scenario.
[ 28. February 2003, 21:03: Message edited by: Howard Bullock ]