c# - Reading Nested Groupnames from Active Directory using Users SAMAccountName -
i need function recursively groups names specified user (as function argument) fellow member of. function header should samaccountname username want groups from:
public list<string> getusersgroups(string samaccountname); i hope can help me.
thanks in advance.
i'm assuming problem active directory side knowledge, not c#.
basically task ldap action, i'll give examples using adfind quick , handy tool output ldap queries csv file example. functions have create yourself.
there 2 functions need:
function 1, find dn samaccountname: adfind -dsq -f samaccountname=username
function 2, find groups, including nested ones: adfind -f "(member:1.2.840.113556.1.4.1941:=cn=userdn,ou=users,dc=domain,dc=com)" samaccountname -list
please find adfind syntax joeware website: http://www.joeware.net/freetools/tools/adfind/usage.htm
for nested groups, more information: http://msdn.microsoft.com/en-us/library/aa746475(v=vs.85).aspx https://social.technet.microsoft.com/forums/scriptcenter/en-us/f238d2b0-a1d7-48e8-8a60-542e7ccfa2e8/recursive-retrieval-of-all-ad-group-memberships-of-a-user?forum=itcg
c# active-directory-group
No comments:
Post a Comment