SPS Farm Report


Today, I learned about a PowerShell script that is already part of some of the diagnostic tools I use in my day to day work and I just didn't know it was in there.  It's freely available online so I wanted to share.

You can go to http://spsfarmreport.codeplex.com/ and download the package to get a full report on your SharePoint farm.

The ReadMe.txt has important information about what will be needed to successfully run the tool.  Because I'm using SharePoint 2013 as a base for my Project Server 2013 installation, I used the PowerShell cmdlet Get-ExecutionPolicy to learn the execution policy was already set to Unrestricted on my test farm.

I downloaded the package, then moved the o15 files to a specially created folder on my Project Server 2013 test server called spsfarmreport.  The really neat thing about this tool is you can run it on only 1 server in the farm and it will grab results from all of them.

So, I ran .\2013SPSFarmReport.ps1 from a PowerShell command prompt window and this was the output…

PS C:\spsfarmreport> .\2013SPSFarmReport.ps1
o15WriteInitialXML
o15farmConfig
o15WriteFarmGenSettings
o15enumServers
o15writeServers
o15enumProdVersions
o15writeProdVersions2
o15enumFeatures
o15writeFeatures
o15enumSolutions
o15writeSolutions
o15enumSvcApps
o15enumSPSearchServiceApps
o15enumSPSearchService
o15enumHostControllers
o15enumSearchActiveTopologies
o15enumSearchConfigAdminComponents
o15enumSearchConfigLinkStores
o15enumSearchConfigCrawlDatabases
o15enumSearchConfigCrawlRules
o15enumSearchConfigQuerySiteSettings
o15enumSearchConfigContentSources
o15writeServiceApps
o15enumSPServiceApplicationPools
o15writeSPServiceApplicationPools
o15enumSPServiceApplicationProxies
o15writeSPServiceApplicationProxies
o15enumSPServiceApplicationProxyGroups
o15writeSPServiceApplicationProxyGroups
o15enumWebApps
o15writeWebApps
o15writeAAMsnAPs
o15enumContentDBs
o15writeContentDBs
o15enumCDConfig
o15writeCDConfig
o15enumHealthReport
o15writeHealthReport
o15enumTimerJobs
o15writeTimerJobs
o15WriteEndXML
PS C:\spsfarmreport>

So where did the output file actually go?  It's not in my special spsfarmreport folder.

The readme file has the answer: Run the "[Environment]::CurrentDirectory" command to know where the output XML is written to.

I did this and found my output was being dropped here in the system32 directory.

PS C:\spsfarmreport> [Environment]::CurrentDirectory
C:\windows\system32

I copied these files to my spsfarmreport folder where the SPSFarmReport.xslt is and was able to open the .xml file using IE.

My report is pretty boring because I only have one SharePoint Server in this farm, but you get the idea. 

Here's a screenshot of the output I see.

Happy hunting!

Comments (12)

  1. Thank you for commenting, BlueSky2010! You are correct, of course, about setting the path ahead of time. I did want to demonstrate what happened to me the first time I ran the script – I lost the output! Administrators who may be less experienced might
    run the spsfarmreport script and be in the same situation, so I feel it is helpful for me to explain the steps I took.

  2. thank you indeed.SPS Farm Report

  3. BlueSky2010 says:

    Thanks – I suppose it's a good idea to change path to the desired location before running the script. 🙂

    1. Ken Higgins says:

      This worked for my purposes: it puts the log and xml files in the directory you are running the script from.

      Put the beginning of the Script: (borrows the environmental variable Current Directory)
      $currentDir = [Environment]::CurrentDirectory
      [Environment]::CurrentDirectory = (Split-Path $MyInvocation.MyCommand.Path)

      Put at the end of the script: (resets the environmental variable to previous value)
      [Environment]::CurrentDirectory = $currentDir

  4. Hi,
    I am full time SharePoint Admin/Consultant and I also use this great script!
    @BlueSky2010 – You can set the path in function o15WriteInitialXML . I have set the first part of the path to $PSScriptRoot . This will generate the xml file in the execution directory. Normally I run the script by going to o15 and there also is located the
    xslt.

  5. Justin, if you can provide more detail on what happens or doesn't happen, any errors you receive, and possibly a screenshot, I might be able to help.

  6. justin says:

    The Farm Report SharePoint 2013 doesn't work for me

    any idea what is wrong? I have SP2013 with CU March 2015

  7. manjari says:

    Hi ,

    I have tried to run this script but getting the error :could not access location csystem32
    And more over a m also getting issue that please run this script on the server where sharepoint is install.
    Please guide steps to remove .

    Thanks.

  8. Manjari,

    The ReadMe.txt has important information about what will be needed to successfully run the tool. The correct path for the system32 directory is c:windowssystem32. You have to be logged onto a SharePoint server that is part of the farm you want to run the
    tool against.

    I hope this helps!

    Brooks.

  9. Frank says:

    Hello,
    I tried to run the “2013SPSFarmReport.ps1” script but its getting stuck after function “Completed running o15enumHealthReport”.
    What could be the issue?
    Thanks for you support!

    1. Hi Frank, I’m really not sure why the script stops running at that point. From a powershell prompt, run [Environment]::CurrentDirectory and search the resulting folder for any kind of log file that might explain what’s happening. I hope this helps.