-
Notifications
You must be signed in to change notification settings - Fork 107
SPService
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Name | Key | String | The name of the service instance to manage | |
Ensure | Write | String | Present to ensure the service runs in the farm, or absent to ensure it is stopped |
Present , Absent
|
InstallAccount | Write | PSCredential | POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5 |
Type: Distributed Requires CredSSP: No
This resource is used to specify if a specific service should be provisioned (Ensure = "Present") or deprovisioned (Ensure = "Absent") in the MinRole configuration of the farm. The name is the display name of the service as shown in the "Services in Farm" page in Central Admin: http://[central_admin_url]/_admin/FarmServices.aspx
The default value for the Ensure parameter is Present. When not specifying this parameter, the service instance is started.
This example shows how to ensure that the Microsoft SharePoint Foundation Sandboxed Code Service is provisioned as a MinRole in the farm.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPService 'Microsoft SharePoint Foundation Sandboxed Code Service'
{
Name = 'Microsoft SharePoint Foundation Sandboxed Code Service'
Ensure = 'Present'
PsDscRunAsCredential = $SetupAccount
}
}
}
This example shows how to ensure that the Microsoft SharePoint Foundation Sandboxed Code Service is deprovisioned as a MinRole in the farm.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPService 'Microsoft SharePoint Foundation Sandboxed Code Service'
{
Name = 'Microsoft SharePoint Foundation Sandboxed Code Service'
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