Set farm property
#input parameters
$propertyName="SomePropertyName"
Add-pssnapin microsoft.sharepoint.powershell -ea 0
$farm=$null
$property=$null
Start-SPAssignment -Global
$farm=Get-SPFarm
$property=$farm.Properties[$propertyName]
#Set value
if($property -ne $null)
{
$val=$false
$farm.Properties[$propertyName]=$val
write-host "Property $propertyName succesfuly set to $val."
}
#Remove property
if($property -eq $null)
{
write-host "Property $propertyName doesn't exist on the farm."
}
else
{
$farm.properties.Remove($propertyName)
write-host "Property $propertyName succesfuly deleted from the farm."
}
#Create property (and set to false)
if($property -eq $null)
{
$farm.Properties.Add($propertyName, $false)
}
#all changes need update
$farm.Update()
Stop-SPAssignment -Global