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.
This link explains the challenges with All
People count: http://www.thesug.org/Discussions/_layouts/Community/Groups/DiscussionPost.aspx?PostID=1776
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 :)
Tuesday, May 1, 2012
Multiline comments in PowerShell Scripts
As
we all know by placing # in starting
of the line in PowerShell script, we can comment single line.
Now
for making multiline comments, we need to use below block.
e.g.
Comments line
Goes here…
#>
Some useful PowerShell Scripts – SharePoint 2010
Script
to delete closed SharePoint web parts: http://blog.philwicklund.com/fff/2012/03/powershell-script-to-delete-closed-sharepoint-web-parts.html
I’ll
update this list periodically.
Enjoy!
Subscribe to:
Comments (Atom)