-
Notifications
You must be signed in to change notification settings - Fork 107
SPManagedAccount
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
AccountName | Key | String | The username of the account | |
Account | Write | PSCredential | The credential with password of the account | |
EmailNotification | Write | UInt32 | How many days before a password change should an email be sent | |
PreExpireDays | Write | UInt32 | How many days before a password expires should it be changed | |
Schedule | Write | String | What is the schedule for the password reset | |
Ensure | Write | String | Present ensures managed account exists, absent ensures it is removed |
Present , Absent
|
Type: Distributed Requires CredSSP: No
This resource will ensure a managed account is provisioned in to the SharePoint farm. The Account object specific the credential to store (including username and password) to set as the managed account. The settings for EmailNotification, PreExpireDays and Schedule all relate to enabling automatic password change for the managed account, leaving these option out of the resource will ensure that no automatic password changing from SharePoint occurs.
The default value for the Ensure parameter is Present. When not specifying this parameter, the managed account is created.
This example shows how to create a new managed account in a local farm.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount,
[Parameter(Mandatory = $true)]
[PSCredential]
$ManagedAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPManagedAccount NewManagedAccount
{
AccountName = $ManagedAccount.UserName
Account = $ManagedAccount
Ensure = "Present"
PsDscRunAsCredential = $SetupAccount
}
}
}
This example shows how to create a new managed account in a local farm, using the automatic password change schedule
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount,
[Parameter(Mandatory = $true)]
[PSCredential]
$ManagedAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPManagedAccount NewManagedAccount
{
AccountName = $ManagedAccount.UserName
Account = $ManagedAccount
Ensure = "Present"
Schedule = "monthly between 7 02:00:00 and 7 03:00:00"
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