SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am interested in finding the Farm Id of my Farm. Where is it located or how do I otherwise find it?

share|improve this question
up vote 1 down vote accepted

To identify a SharePoint 2007 Farm ID, you can install Microsoft Powershell onto your local development image from. (

Powershell is installed as a hotfix and can be identified as such in Add/Remove programs.

Running powershell, follow these commands, Set-ExecutionPolicy RemoteSigned[System.Reflection.Assembly]::LoadWithPartialName(“”Microsoft.SharePoint”")$spFarm = [Microsoft.SharePoint.Administration.SPfarm]::Local$spFarm Look for the ID field, this GUID is your SharePoint Farm Id. Remember to exit from the Powershell command prompt once your done.

share|improve this answer
So there is one detail to the above instructions that was missed. Please remember to load powershell as an administrator to set the execution policy. – Mike T Jan 12 '11 at 17:27

The correct syntax for anyone unlucky enough to still be managing a 2007 farm is below:

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint");    [Microsoft.SharePoint.Administration.SPFarm]::Local.ID
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.