Function Reference

_AD_RecursiveGetMemberOf

Takes a group, user or computer and recursively returns a list of groups the object is a member of.

#Include <AD.au3>
_AD_RecursiveGetMemberOf($sObject[, $iDepth = 10[, $bListInherited = True[, $bFQDN = True]]])

 

Parameters

$sObject User, group or computer for which the group membership is to be returned. Can be specified as Fully Qualified Domain Name (FQDN) or sAMAccountName
$iDepth Optional: Maximum depth of recursion (default = 10)
$bListInherited Optional: Defines if the function returns the group(s) it was inherited from (default = True)
$bFQDN Optional: Specifies the attribute to be returned. True = distinguishedName (FQDN), False = SamAccountName (default = True)

 

Return Value

Success: Returns an one-based one dimensional array of group names (FQDN or sAMAccountName) the user or group is a member of
Failure: "", sets @error to:
    1 - Specified user, group or computer does not exist

 

Remarks

This function traverses the groups that the object is immediately a member of while also checking its group membership.
For groups that are inherited, the return is the FQDN or sAMAccountname of the group, user or computer, and the FQDN(s) or sAMAccountname(s) of the group(s) it
was inherited from, seperated by '|'(s) if flag $bListInherited is set to True.

If flag $bListInherited is set to False then the group names are sorted and only unique groups are returned.

 

Related

_AD_IsMemberOf, _AD_GetUserGroups, _AD_GetUserPrimaryGroup