diff --git a/reference/7/Microsoft.PowerShell.Management/Set-Service.md b/reference/7/Microsoft.PowerShell.Management/Set-Service.md index 7864f2a1c624..1ce289ba04a9 100644 --- a/reference/7/Microsoft.PowerShell.Management/Set-Service.md +++ b/reference/7/Microsoft.PowerShell.Management/Set-Service.md @@ -19,7 +19,7 @@ Starts, stops, and suspends a service, and changes its properties. ``` Set-Service [-Name] [-DisplayName ] [-Credential ] [-Description ] - [-StartupType ] [-Status ] [-PassThru] [-WhatIf] [-Confirm] + [-StartupType ] [-Status ] [-SecurityDescriptorSddl ] [-PassThru] [-WhatIf] [-Confirm] [] ``` @@ -27,7 +27,7 @@ Set-Service [-Name] [-DisplayName ] [-Credential ``` Set-Service [-InputObject] [-DisplayName ] [-Credential ] - [-Description ] [-StartupType ] [-Status ] [-PassThru] [-WhatIf] + [-Description ] [-StartupType ] [-SecurityDescriptorSddl ] [-Status ] [-PassThru] [-WhatIf] [-Confirm] [] ``` @@ -159,6 +159,19 @@ The command stores the credentials in the `$credential` variable. The second command changes the credentials of the Schedule service. +### Example 9: Change the SecurityDescriptor of a service + +```powershell +$SDDLToSet = "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;SU)" +Set-Service -Name "BITS" -SecurityDescriptorSddl $SDDLToSet +``` + +These commands changes SecurityDescriptor of the BITS service. + +The command stores the SecurityDescriptor in the `$SDDLToSet` variable. + +The second command changes the SecurityDescriptor of the BITS service. + ## PARAMETERS ### -Credential @@ -314,6 +327,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -SecurityDescriptorSddl + +Specifies the SecurityDescriptor for the service in Sddl format. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet.