Hey guys...
I tried the methods you suggested.
However, I cannot seem to get JUST a list of groups and membership like I want.
Are you sure this will catch membership where the member is not recognized?
Also, for some reason, it repeats the member list four times for each group... I must have an extra loop somewhere but I can only understand this code enough to get it to run. ;(
To clarify my request, basically I want to find any groups in my domain that have unrecognized userid's in global groups.
We recently carved out a part of our company and this is the cleanup phase after the fact.
Thanks... and here is my code followed by part of the output file:
Code:
break ON
$= SetOption("WrapAtEol","On")
? "KiXtart version = " @KIX
; Win32Admin.DLL documentation and example KiXtart code
; All method set return data or true on success or nothing on failure.
; Also @error is set when an error occurs but does not seem to be reset on success.
; Therefore, checking the function result seems to be the best method of
; determining when an error occurs.
; @Error may not reflect the actual error of methods. Be sure to
; check @serror as it will reflect the correct text of the COM error.
$Win32Admin = createobject("Win32Admin")
if vartypename($Win32Admin) <> "Object"
? "@serror"
endif
; Method GrpEnum($Server, "global"|"local", optional $InclDesc)
; Enumerates all "global" or "local" groups on $Server.
;
; Returns either an array of dictionary objects
; Local group keys: (comment, name)
; Global group keys: (attributes, comment, group_id, name)
;
RedirectOutput("c:\scripts\globalgroups.log")
$Groups = $Win32Admin.GrpEnum("MOP002", "global")
if @error = 0
for each $Group in $Groups
$keys = $Group.keys
for each $key in $keys
$Value = $Group.get($key)
If $key = "name"
$grpname=$Value
?$grpname
EndIf
$Members = $Win32Admin.GrpEnumMembers(MOP002, "global","$grpname")
for each $Member in $Members
$toys = $Member.keys
for each $toy in $toys
$Value = $Member.get($toy)
If $toy = "name"
$memname=$Value
?" " + $memname
EndIf
next
next
next
next
else
? "Error: @error @serror"
endif
RedirectOutput("")
Code:
AA_DriveBF
MLBQS
MOJGS
MLCAR
MLOPI
TERM ESBUR
_BRKL ADMINISTRATION TEMPLATE
UKMYA
MLBQS
MOJGS
MLCAR
MLOPI
TERM ESBUR
_BRKL ADMINISTRATION TEMPLATE
UKMYA
MLBQS
MOJGS
MLCAR
MLOPI
TERM ESBUR
_BRKL ADMINISTRATION TEMPLATE
UKMYA
MLBQS
MOJGS
MLCAR
MLOPI
TERM ESBUR
_BRKL ADMINISTRATION TEMPLATE
UKMYA