Pages

Monday, July 23, 2012

Iterating through every SharePoint Web Applications, Site Collections, and Sites (Webs)

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.


Navigation link is not appearing into SharePoint site


I was getting “Quick Launch” and “Top Link Bar” links and wondering why “Navigation” link disappear from the Look and Feel section of the site settings then I have figured out that we need to activate “SharePoint Server Publishing Infrastructure” on site collection level feature. 


After activating this site collection feature, I am able to see navigation link and other two links goes away :)