-
Notifications
You must be signed in to change notification settings - Fork 107
SPWebAppPropertyBag
dscbot edited this page Mar 17, 2023
·
8 revisions
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
WebAppUrl | Key | String | The URL of the web application | |
Key | Key | String | The key of the SPWebApplication property | |
Value | Write | String | Value of the SPWebApplication property | |
Ensure | Write | String | Set to present to ensure the SPWebApplication property exists, or absent to ensure it is removed |
Present , Absent
|
Type: Distributed Requires CredSSP: No
This resource is used to work with SharePoint Property Bags at the web application level. The account that runs this resource must be a farm administrator.
The default value for the Ensure parameter is Present. When not specifying this parameter, the property bag is configured.
This example shows how add property bag value in a web application.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPWebAppPropertyBag APPLICATION_APPCodeProperty
{
PsDscRunAsCredential = $SetupAccount
WebAppUrl = "https://web.contoso.com"
Key = "KeyToAdd"
Value = "ValueToAddOrModify"
Ensure = "Present"
}
}
}
This example shows how remove a property bag value in a web application.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPWebAppPropertyBag APPLICATION_APPCodeProperty
{
PsDscRunAsCredential = $SetupAccount
WebAppUrl = "https://web.contoso.com"
Key = "KeyToRemove"
Ensure = "Absent"
}
}
}
- Home
- Getting Started
- Pre-requisites
- Installing the module
- Exporting SharePoint Configuration
- Creating Configuration Files
- Pre-created Examples
- Creating an Azure development environment
- Understanding Resources & Syntax
- Remote PowerShell Authentication
- Contributing to SharePointDsc
- Other useful modules for SharePoint DSC configurations