5

I am trying to get members of a Tridion group which is mapped to an Active directory group.

I am trying to get these details using the Core Service.

The Groupdata/GetXMLList() gives only the users/subgroups that are added manually to the group but not the users in the active directory group.

Is there a way to get all (active directory as well as manually added) users list ?

GroupData group12 = (GroupData)_client.Read(subGroupId, new ReadOptions());
var xe12 = (XElement)_client.GetListXml(subGroupId, groupMembersFilter);

1 Answer 1

4

The thing is that members of a directory service group are added only if they have logged in to Tridion at least once. If you want to browse the directory service group users you need to get the path of the active directory group (subtree, leaf) by looking at:

 GroupData group12 = (GroupData)_client.Read(subGroupId, new ReadOptions());

 var searchDn =((DirectoryGroupMappingData) group12.ClaimMappings.First()).SearchDN;
 var directoryServiceName = ((DirectoryGroupMappingData) group12.ClaimMappings.First()).DirectoryServiceName;
 var result = _client.GetListDirectoryServiceGroupMembers(directoryServiceName, searchDn);

I can't test it at the moment, but it should give enough directions.

Keep in mind that code assumes that there's just one ClaimMapping in the group and that it's of type DirectoryGroupMappingData, which is not always true

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.