@@ -19,15 +19,15 @@ Starts, stops, and suspends a service, and changes its properties.
1919
2020```
2121Set-Service [-Name] <String> [-DisplayName <String>] [-Credential <PSCredential>] [-Description <String>]
22- [-StartupType <ServiceStartupType>] [-Status <String>] [-PassThru] [-WhatIf] [-Confirm]
22+ [-StartupType <ServiceStartupType>] [-Status <String>] [-SecurityDescriptorSddl <String>] [- PassThru] [-WhatIf] [-Confirm]
2323 [<CommonParameters>]
2424```
2525
2626### InputObject
2727
2828```
2929Set-Service [-InputObject] <ServiceController> [-DisplayName <String>] [-Credential <PSCredential>]
30- [-Description <String>] [-StartupType <ServiceStartupType>] [-Status <String>] [-PassThru] [-WhatIf]
30+ [-Description <String>] [-StartupType <ServiceStartupType>] [-SecurityDescriptorSddl <String>] [- Status <String>] [-PassThru] [-WhatIf]
3131 [-Confirm] [<CommonParameters>]
3232```
3333
@@ -159,6 +159,19 @@ The command stores the credentials in the `$credential` variable.
159159
160160The second command changes the credentials of the Schedule service.
161161
162+ ### Example 9: Change the SecurityDescriptor of a service
163+
164+ ``` powershell
165+ $SDDLToSet = "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;SU)"
166+ Set-Service -Name "BITS" -SecurityDescriptorSddl $SDDLToSet
167+ ```
168+
169+ These commands changes SecurityDescriptor of the BITS service.
170+
171+ The command stores the SecurityDescriptor in the ` $SDDLToSet ` variable.
172+
173+ The second command changes the SecurityDescriptor of the BITS service.
174+
162175## PARAMETERS
163176
164177### -Credential
@@ -314,6 +327,22 @@ Accept pipeline input: False
314327Accept wildcard characters: False
315328` ` `
316329
330+ # ## -SecurityDescriptorSddl
331+
332+ Specifies the SecurityDescriptor for the service in Sddl format.
333+
334+ ` ` ` yaml
335+ Type: String
336+ Parameter Sets: (All)
337+ Aliases:
338+
339+ Required: False
340+ Position: Named
341+ Default value: None
342+ Accept pipeline input: False
343+ Accept wildcard characters: False
344+ ` ` `
345+
317346# ## -Confirm
318347
319348Prompts you for confirmation before running the cmdlet.
0 commit comments