1

I would like to get distinguish name "CN=XXX,CN=Users,DC=contoso,DC=com" I know there is a function "LookupAccountSid" that get only the name of the account for SID.

Is there any similar function that get the distinguish name? on c++

moran
  • 51
  • 2
  • 9

1 Answers1

0

If you want user account name associated with the caller thread, use GetUserNameEx function with the NameFullyQualifiedDN parameter. You could obtain additional information using IADsADSystemInfo interface. If you want to enumerate domain accounts, you could use ADSI interfaces.

Ari0nhh
  • 5,720
  • 3
  • 28
  • 33
  • Thank you for your quick replay. I have look on IADsGroup interface and there is a method called "IsMember" that check if a user is an immediate member of the group. Is there any to know if a user is member of nested group? using ADSI interfaces. – moran Jun 20 '16 at 11:02
  • ADSI does not have such a method. Some approaches to solve this problem were described in this question: http://stackoverflow.com/questions/21963771/adsi-indirect-group-membership – Ari0nhh Jun 20 '16 at 11:21