Friday, April 3, 2015

Get All Users from a SharePoint Site

Every now &  then you run into a request where someone wants to know who all has access to a specific SharePoint site. All those who have fancy tools to work with don't have to worry about this, however some poor souls like me have to depend on PowerShell.

You can invoke the script by doing something like this.

$Users = Get-UsersInWeb -Url http://portal.contoso.com/sites/somesite

Once you have populated the variable $Users, you should be able to easily export it to CSV using a statement like the one below:


$Users | ConvertTo-Csv -NoTypeInformation | Out-File c:\users.csv

Monday, January 26, 2015

Extract Farm Solutions from SharePoint Server

Recently I was setting up a replica of an existing production farm for QA & Dev purposes and I again got myself into a situation where people didn't know which was  the correct version of the code deployed to the farm.  The one pulled from the source control and the one running on the production farm were obviously yards & miles away. While how to do release management is not the part of this post, I wanted to highlight a neat trick that administrators and developers can use to get a copy of solution packages straight from the farm.

The following snippet will help you do just that.

Thursday, January 15, 2015

Debug Messages, Stack Trace & the Notorious web.config

The number of times one must enable debugging in web.config is really high and one thing to remember always is that enabling debugging only in the web application's web.config isn't of a lot of help at all times. So always check the following and enable debugging in these places too.

  1. \14\TEMPLATE\LAYOUTS\web.config
  2. \14\TEMPLATE\ADMIN\web.config
  3. Finally the web.config of your web application
Always perform the following on all the config files.
  • customErrors mode="Off"
  • CallStack="true"
  • compilation batch="true" debug="true" optimizeCompilations="true"

And BTW, there's nothing new in here. I just need a place where I can find this every single time I need it.