Skip to content

Commit 240d71b

Browse files
kvprasoonsdwheeler
authored andcommitted
Documentation changes for new -SecurityDescriptorSddl parameter in Set-Service (#3880)
* Documentation changes for new parameter in Set-Service * revert changes in v6 * change v7 doc * Revert "change v7 doc" This reverts commit 7ac5703. * Revert "revert changes in v6" This reverts commit 62d1516. * revert v6 changes * add changes to v7
1 parent 88ee5df commit 240d71b

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

reference/7/Microsoft.PowerShell.Management/Set-Service.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ Starts, stops, and suspends a service, and changes its properties.
1919

2020
```
2121
Set-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
```
2929
Set-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

160160
The 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
314327
Accept 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

319348
Prompts you for confirmation before running the cmdlet.

0 commit comments

Comments
 (0)