Pages

Monday, July 23, 2012

Problems getting exact count of users from People and Groups: All People using SharePoint object model


There is no direct way or correct way to get all the all the users from “All People” link from SharePoint using object model. I have tried every different options from programming but none of the method gave me correct results, like web.AllUsers, web.Users, web.SiteUsers. but these properties are giving me incorrect results.


Basically I want to know and check how many users into any particular SharePoint site. After digging more into it I have found out that maybe it’s not possible to get correct count with one property, so I have changed my code to get all the users from SharePoint site like this : I am looping through all the SharePoint site groups and counting unique users from code as well as from web.Users property.


No comments:

Post a Comment