Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions reference/7/Microsoft.PowerShell.Management/Set-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ Starts, stops, and suspends a service, and changes its properties.

```
Set-Service [-Name] <String> [-DisplayName <String>] [-Credential <PSCredential>] [-Description <String>]
[-StartupType <ServiceStartupType>] [-Status <String>] [-PassThru] [-WhatIf] [-Confirm]
[-StartupType <ServiceStartupType>] [-Status <String>] [-SecurityDescriptorSddl <String>] [-PassThru] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

### InputObject

```
Set-Service [-InputObject] <ServiceController> [-DisplayName <String>] [-Credential <PSCredential>]
[-Description <String>] [-StartupType <ServiceStartupType>] [-Status <String>] [-PassThru] [-WhatIf]
[-Description <String>] [-StartupType <ServiceStartupType>] [-SecurityDescriptorSddl <String>] [-Status <String>] [-PassThru] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down