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 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?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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).

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.