I am trying to establish whether it is possible to determine indirect group membership (i.e. being in an AD group who is in a SharePoint Group) remotely using the .NET Managed API (client side).

The server side code (which I know works) is simple enough by checking SPGroup.ContainsCurrentUser (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spgroup.containscurrentuser.aspx). This will recursively check any AD Groups that the user is a member of as well as explicit membership.

The only Client Side Object Model API call I can find that would be similar would be the User.Groups property, which lists the groups that the specified user is a member of, but this does not seem to include indirect membership (and only includes those where the explicit account has been added).

Example Scenario I have a user (domain\me).

I have two SharePoint Groups:

  • Group 1 (contains "domain\me")
  • Group 2 (contains "domain\domain users")

When logged in as domain\me then calling SPGroup.ContainsCurrentUser returns true for both groups.

Calling the client side code (context.Web.CurrentUser.Groups) only returns Group 1

Anyone know how I can do this without using Server Side code?

1 Answer 1


I think you might find your answer in this thread where a person asks the same question.

I think you'd be better off writing a quick asp.net page that you could call via AJAX and get some JSON back. .NET directory services class are going to be much better at talking to Active Directory than javascript, unless you can find a js library specifically for this (which I haven't been able to find).

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.