-
Notifications
You must be signed in to change notification settings - Fork 107
SPFarmPropertyBag
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Key | Key | String | The key of the SPFarm property bag | |
Value | Write | String | Value of the SPfarm property bag | |
ParameterType | Write | String | Type of the data in the Value parameter |
Boolean , String , Int32
|
Ensure | Write | String | Set to present to ensure the SPfarm 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 farm level. The account that runs this resource must be a farm administrator.
The Value parameter must be in string format, but with the ParameterType parameter, you can specify of which data type the data in Value is: String, Boolean or Int32. See the examples for more information.
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 in the current farm.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPFarmPropertyBag 'SetStringValue'
{
Key = 'FARM_TYPE'
Value = 'SearchFarm'
ParameterType = 'String'
Ensure = 'Present'
PsDscRunAsCredential = $SetupAccount
}
}
}
This example shows how add property bag in the current farm.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPFarmPropertyBag 'SetBooleanValue'
{
Key = 'disableIntranetCalls'
Value = 'False'
ParameterType = 'Boolean'
Ensure = 'Present'
PsDscRunAsCredential = $SetupAccount
}
}
}
This example shows how add property bag in the current farm.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPFarmPropertyBag 'SetIntValue'
{
Key = 'AnswerToEverything'
Value = '42'
ParameterType = 'Int32'
Ensure = 'Present'
PsDscRunAsCredential = $SetupAccount
}
}
}
This example shows how remove property bag in the current farm.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPFarmPropertyBag 'RemoveVlaue'
{
Key = 'KeyToRemove'
Ensure = 'Absent'
PsDscRunAsCredential = $SetupAccount
}
}
}
- 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