-
Notifications
You must be signed in to change notification settings - Fork 107
SPPublishServiceApplication
dscbot edited this page Mar 17, 2023
·
17 revisions
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Name | Key | String | The name of the service application to publish | |
Ensure | Write | String | Present to ensure it runs on this server, or absent to ensure it is stopped |
Present , Absent
|
Type: Distributed Requires CredSSP: No
This resource is used to specify if a specific service application should be published (Ensure = "Present") or not published (Ensure = "Absent") on the current server. The name is the display name of the service application as shown in the Central Admin website.
You can publish the following service applications in a SharePoint Server 2013/2016/2019 farm:
- Business Data Connectivity
- Machine Translation
- Managed Metadata
- User Profile
- Search
- Secure Store
The default value for the Ensure parameter is Present. When not specifying this parameter, the service application is provisioned.
This example shows how to ensure that the managed metadata service is published within the farm.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPPublishServiceApplication PublishManagedMetadataServiceApp
{
Name = "Managed Metadata Service Application"
Ensure = "Present"
PsDscRunAsCredential = $SetupAccount
}
}
}
This example shows how to ensure that the Secure Store Service is not published within the farm.
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost
{
SPPublishServiceApplication UnpublishSecureStoreServiceApp
{
Name = "Secure Store Service Application"
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