Showing posts with label property bag. Show all posts
Showing posts with label property bag. Show all posts

Powershell to get Property bag for Farm, Web App or Site Collection

Application developers, now a days store many of the configurable properties in the Property bags. As an administrator you might frequently be asked the value of these properties.

I  used below scripts to check Properties at Farm, Web Application and Site Collection level.

#Add PS SnapIn for SharePoint

# Get all the Properties from Farm Property bag
$myFarm = Get-SPFarm;

foreach ($prop in $myFarm.Properties.GetEnumerator() | Sort-Object -Property Name) {
                     Write-Host " - " $prop.Name "->" $prop.Value
}

# Get all the Properties from Web Application Property bag
$myWebApp = Get-SPWebApplication "http://webapp"

foreach ($prop in $myWebApp.Properties.GetEnumerator() | Sort-Object -Property Name) {
                     Write-Host " - " $prop.Name "->" $prop.Value
}

# Get all the Properties from Site Collection Property bag
$myWeb = Get-SPWeb "http://sitecollection"

foreach ($prop in $myWeb.Properties.GetEnumerator() | Sort-Object -Property Name) {
                     Write-Host " - " $prop.Name "->" $prop.Value
}