using (SPSite site = new SPSite(SPContext.Current.Site.Url)) { SPWebApplication webApp = site.WebApplication; foreach (SPSite sitecol in webApp.Sites) { SPWebCollection webs = sitecol.AllWebs; foreach (SPWeb web in webs) { SPUserCollection users = web.SiteUsers; foreach (SPUser user in users) { //code } } } }
No comments:
Post a Comment