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 have a few custom settings for my feature that I am creating. I want a way to populate these values on install with some default values. However if needed an admin should be able to change the defaults via powershell. Is this possible? The settings would be at the web applciation level but could saved somewhere else if that would help.

Wictor has Six ways to store settings in SharePoint would any of these meet my needs?

share|improve this question
up vote 2 down vote accepted

Actually you can reach almost any SharePoint object from the PowerShell.

For example, SPWebApplication.Properties can be modified using the following PowerShell code:

$web = Get-SPWeb http://localhost
$webApplication = $w.Site.WebApplication
$webApplication.Properties["xxx"] = "yyy"


enter image description here

To set the default values, you can use C# code in Feature Receiver.

Please, note, that for activating WebApplication-scoped feature, as well as for accessing the SPWebApplication.Properties collection, you should have farm administrator permissions.

share|improve this answer

I think what would work for you is the property bag. Since its accessible via .NET you can write powershell scripts to interact with them accordingly.

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.