Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've been trying to get all the RoleAssignments using the COM interface. the problem is that i get the AD user group names instead of the actual users inside the groups.

my code looks something like this:

ClientContext cc = new ClientContext(#SiteURL);

RoleAssignmentCollection Roles = cc.Web.RoleAssignments;

IEnumerable<RoleAssignment> newRoleAssignmentsCollection = cc.LoadQuery(Role.Include(role => role.Member));

AsyncDelegate execDel = new AsyncDelegate(cc.ExecuteQuery);

execDel.BeginInvoke(arg => { cc.ExecuteQuery();

foreach (RoleAssignment RoleAssign in newRoleAssignmentsCollection)
{ 
    RoleAssign.Member.LoginName; // <------- Here is my problem!!! 
}

}, null);

Can anyone please tell me how to get the users which are inside the Active Directory group?

Thanks in advance, Itay.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Are you saying that you have AD groups assigned permissions in that site and you want to know the names of the users that are members of the AD group?

If so, SharePoint doesn't know that information, you need to query it from AD directly.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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