Quote:

See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/iadsgroup.asp for a method to return the group memberships of an arbitrary user.




Thanks. But in looking at the documentation for "IsMember" it says:

bMember
[out] Pointer to a VARIANT_BOOL value that receives VARIANT_TRUE if the object is an immediate member of the group or VARIANT_FALSE otherwise.

My testing confirms this. It reports a true when the user is an immediate member. It reports a false when the user is a member via nesting.

Code:

$User = "jsmith"
$Group = "Support Staff"

$grp = GetObject("WinNT://SCONET/" + $Group)
? $User + " ---> " + $Group + " = " + $grp.IsMember("WinNT://SCONET/"+$User)