Get Farm name?

Jan 11, 2013 at 2:20 PM

Hi,

I am not able to determine if the command Get-SPFarm gives farm name or configuariton db name. Is there any way to find out farm name? I did not create this farm so i do not know what name was given to farm. Can any one of you help?

Coordinator
Jan 11, 2013 at 6:32 PM
Edited Jan 11, 2013 at 8:09 PM

Hi,

Getting the farm name can be achieved by the following:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$Farm = Get-SPFarm 
$FarmName = $Farm.Name 

Remove-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

This returns the name of Config DB. The farm name in the XML is merely free  text where you can enter a meaningful and friendly name like for example:

 COMPANY NAME SP2010 - UAT

or 

COMPANY NAME SP2010 - PRODUCTION