0

We are using SharePoint 2013 and there is one property bag having key as "DATA". i want a powershell script to know in what all sites this "DATA" property is there and what is the value of this in those sites. I dont want any other property bag result.Please help

  • is web, site or list level property bag you are looking for? – Karthik Jaganathan Jan 18 at 10:58
2
  Get-SPSite -Limit all | % {
    if($_.RootWeb.Properties['DATA'] -ne $null){
      Write-Host $_.Url
    }
  }
  • thanks for the response. Can you please tell me that why you have used "| %" in your script? what is the purpose of that? – Adarsh Awasthi Jan 23 at 5:46
  • 1
    The first symbol is a pipe (this one -> |). It takes the output of the "Get-SPSite" command and puts it to the next command. The next command, in this script, is the percent-sign. It's an abbreviation/alias for the command "For-EachObject". So, the script gets all the Sites and iterates over them to test every site for the property bag property. Here is a list of alias: ilovepowershell.com/2011/11/03/list-of-top-powershell-alias – engineerer Jan 23 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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