Tell if user exists in SharePoint Group through web service

mosssharepointsharepoint-2007web services

I am working on an internal web application that will use predefined SharePoint groups for determining a user's security level. I have done some research and found SharePoint's "usergroup" web service which has the method "GetUserCollectionFromGroup()" which will list all of the users in a given SharePoint group.

The problem I am having is some of the predefined SharePoint groups have Active Directory groups added to them, not the individual users. So, when I call GetUserCollectionFromGroup("Members") I get back a single entry for the Active Directory group "DOMAIN\domain users\". Is there a way to check if either a user or an Active Directory group that the user belongs to is a member of a SharePoint group using only SharePoint web services? Or will I need to check the SharePoint group and then lookup any and all Active Directory groups to see if this user is a member there also?

Best Answer

Active Directory Security Groups are seen as "Users" in SharePoint. You cannot achieve that in the way you want.

But since you do have the DOMAIN\group you can extend your code after you hit the SharePoint webservices API and use the System.DirectoryServices namespace to resolve your users. You can find a good example on how to get users from a group here.

Related Topic