1
votes

Has anybody have the awareness about to getting all the users from all the site and sub sites. I want to create a access report that will describes each users permission in each and every site and sub site in sharepoint. I am getting all the site and subsites. and i can take the users from each site. But i wish to know that is there any way to get all users firstly and then they involved sites. and what are the permission for each users in that sites.

Thanks in adavance..

2
What have you tried? This should be pretty trivial operation. If you know how to look up a single user you can iterate over all users.Security Hound
client object model? server client model ?Sebastian 506563

2 Answers

0
votes

We had this one time but what we had was we had our SharePoint server connect to a SQL server which then saves all the users into a single table, together with the permission and the site.

You can use this site as reference as it seems to be the same thing as what you're asking: How to get a list of all users in SharePoint

0
votes

_web - is web context from site context etc.

SPGroupCollection _collGroups = _web.Groups;
                        foreach (SPUser _User in _web.SiteUsers)
                        {
                           //your code here 
                        }

here u have some client object model how to get users FROM SITE collection scope, if u want to get it from all sites it depend what kind of scope or feature we are talking about becouse they could be other way depend of permission (timer jobs webparts etc) . other way is to get

SPSiteDataQuery

and then

SPSiteDataQuery.Users