Count all documents in all libraries

June 2, 2015

The command below will give a list of library urls and the number of documents in each.  The output is written to a csv file

Get-SPWeb http://yoursite| Select -ExpandProperty Lists |  Select -ExpandProperty Items |  Group {$_.ParentList.ParentWeb.Url + “/” + $_.ParentList.Title} |  Select Name, Count |Export-Csv “C:\SPListReport.csv”


Get site collection and their database

June 2, 2015

Sometimes as an Admin you might need to know what site collections are  stored in  databases on your Farm.  PowerShelll offers a quick way to do this. The following command will find the database name and site collections, then export the information to a text file

Get-SPContentDatabase | %{Write-Output “- $($_.Name)”; foreach($site in $_.sites){write-Output $site.url}} > C:\sitecollections.txt

 

 



SharePoint 2010 Library Context Menu Error – Item does not exist…

October 11, 2013

Strange and annoying to get this error message when you can see the document exists and is not checked out by another user.

Solution:

Go to the document library and edit the page.  Click on modify webpart (the web part with the folders or documents giving the error that is) and then open the properties dialog and click ok.  You will see that the context menu is now  working.  Took ages to find out how to solve this annoying problem. I hope this will help someone else.:)


SharePoint Installer Scripts Fail

June 26, 2013

There are several reasons why your installer script might fail. Most common reason I have enountered is bad typing on my part 😦 when things have been incrrectly spelt !  Other reasons have been where the managed accounts have not been given the correct permissions by IT. Recently I bumped into a new error that I had not seen before when running installation scripts on servers outside out own control.  Turns out the problem was the scripts were being blocked by FIPS local security policy that was blocking the Installation script.  Once FIPS was disabled my script (that I knew was good) ran like a dream.

Note that there are 3 places where you need to disable FIPS – please refer to the links below.

http://collaborationsharepoint.blogspot.co.uk/2010/10/this-implementation-is-not-part-of.html

http://social.technet.microsoft.com/Forums/en-US/81e1b564-c722-4aea-b7a1-788ff35e055d/sharepoint-2010-installation-failed-fips-validated-cryptographic-algorithms

SharePoint is a dark art 🙂


InfoPath Form error opening form for second time

June 15, 2013

This is something that might make you scratch your head for a while if it happens to you. Publish your form as full trust InfoPath template. Activate to the site collection and all is OK. You open the form fill out some fields and save it. Still OK. You go back and open the form again but this time you get an error message box appear. This says you can continue or start over. If you continue the form opens, but you will not be able to make any changes to the form and save it. If your form has code behind then check the version of SharePoint.dll that the form is referencing and then go to the server and see what version of SharePoint.dll is in the GAC. Chances are the versions will be different that this is what is causing the error. Copy the version from the GAC, open your form template and use the SharePoint.dll that is from the GAC. Rebuild the form. Deploy it again to Central Administration and you will find that the form will work OK.

Hope this helps 🙂


Cannot Activate InfoPath form to Site Collection when uploaded into Central Admin (2007)

June 13, 2013

Error Publishing and Activating InfoPath to a site collection

Ok this was a tad annoying. I had published my InfoPath form template as an administrative approved Full Trust template via Central Administration, then I wanted to ativate it a site collection. This did not want to work although everything I had done in the GUI was correct !

Broke out the lovely PowerShell console and did the following:-
Test-SPInfoPathFormTemplate
When Powershell returned all was ok I then ran
Enable-SPInfoPathFormTemplate

Hey presto all was well and I could use the form by adding it as a content type to the site library.

Hope this helps other who get this problem. 🙂