Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 11 additions & 10 deletions reference/5.1/Microsoft.PowerShell.Management/Set-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 03/20/2024
ms.date: 02/04/2026
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/set-service?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Set-Service
Expand Down Expand Up @@ -168,6 +168,7 @@ Name StartType
spooler Automatic
SQLWriter Automatic
```

## PARAMETERS

### -ComputerName
Expand Down Expand Up @@ -291,18 +292,18 @@ Accept wildcard characters: False

Sets the startup type of the service. The acceptable values for this parameter are:

- **Automatic** - The service is started or was started by the operating system, at system start-up.
- `Automatic` - The service is started or was started by the operating system, at system start-up.
If an automatically started service depends on a manually started service, the manually started
service is also started automatically at system startup.
- **Disabled** - The service is disabled and cannot be started by a user or application.
- **Manual** - The service is started only manually, by a user, using the Service Control Manager,
- `Disabled` - The service is disabled and cannot be started by a user or application.
- `Manual` - The service is started only manually, by a user, using the Service Control Manager,
or by an application.
- **Boot** - Indicates that the service is a device driver started by the system loader. This
- `Boot` - Indicates that the service is a device driver started by the system loader. This
value is valid only for device drivers.
- **System** - Indicates that the service is a device driver started by the 'IOInitSystem()'
- `System` - Indicates that the service is a device driver started by the 'IOInitSystem()'
function. This value is valid only for device drivers.

The default value is **Automatic**.
The default value is `Automatic`.

```yaml
Type: System.ServiceProcess.ServiceStartMode
Expand All @@ -323,9 +324,9 @@ Specifies the status for the service.

The acceptable values for this parameter are as follows:

- **Paused**. Suspends the service.
- **Running**. Starts the service.
- **Stopped**. Stops the service.
- `Paused`. Suspends the service.
- `Running`. Starts the service.
- `Stopped`. Stops the service.

```yaml
Type: System.String
Expand Down
27 changes: 18 additions & 9 deletions reference/7.4/Microsoft.PowerShell.Management/Get-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 03/20/2024
ms.date: 02/04/2026
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-service?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
aliases:
Expand Down Expand Up @@ -108,10 +108,10 @@ Status is only one property of service objects. To see all of the properties, ty
This example gets services that have dependent services.

```powershell
Get-Service |
Where-Object {$_.DependentServices} |
Get-Service | Where-Object {$_.DependentServices} |
Format-List -Property Name, DependentServices, @{
Label="NoOfDependentServices"; Expression={$_.DependentServices.Count}
Label = "NoOfDependentServices"
Expression = {$_.DependentServices.Count}
}
```

Expand Down Expand Up @@ -140,7 +140,7 @@ This example shows that when you sort services in ascending order by the value o
property, stopped services appear before running services. This happens because the value of
**Status** is an enumeration, in which `Stopped` has a value of `1`, and `Running` has a value of
`4`. For more information, see
[ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus).
[ServiceControllerStatus](xref:System.ServiceProcess.ServiceControllerStatus).

To list running services first, use the **Descending** parameter of the `Sort-Object` cmdlet.

Expand Down Expand Up @@ -338,9 +338,16 @@ PowerShell includes the following aliases for `Get-Service`:

This cmdlet is only available on Windows platforms.

Beginning in PowerShell 6.0, the following properties are added to the **ServiceController**
objects: **UserName**, **Description**, **DelayedAutoStart**, **BinaryPathName**, and
**StartupType** .
PowerShell 6.0 introduced the following changes:

- The **ServiceController** objects now include the following properties:
- **UserName**
- **Description**
- **DelayedAutoStart**
- **BinaryPathName**
- **StartupType**
- The command no longer includes the **ComputerName** parameter. To use this command on a remote computer,
use the `Invoke-Command` to target a remote system.

This cmdlet can display services only when the current user has permission to see them. If this
cmdlet does not display services, you might not have permission to see them.
Expand All @@ -363,10 +370,12 @@ services. The **Status** property of a service is an enumerated value in which t
statuses represent integer values. The sort is based on the integer value, not the name. `Running`
appears before `Stopped` because `Stopped` has a value of `1`, and `Running` has a value of `4`. For
more information, see
[ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus).
[ServiceControllerStatus](xref:System.ServiceProcess.ServiceControllerStatus).

## RELATED LINKS

[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md)

[New-Service](New-Service.md)

[Restart-Service](Restart-Service.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 12/12/2022
ms.date: 02/04/2026
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/new-service?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: New-Service
Expand Down Expand Up @@ -318,8 +318,13 @@ This cmdlet is only available on Windows platforms.

To run this cmdlet, start PowerShell by using the **Run as administrator** option.

Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use
this command on a remote computer, use the `Invoke-Command` to target a remote system.

## RELATED LINKS

[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md)

[Get-Service](Get-Service.md)

[Restart-Service](Restart-Service.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 12/12/2022
ms.date: 02/04/2026
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/remove-service?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Remove-Service
Expand Down Expand Up @@ -152,8 +152,13 @@ This cmdlet is only available on Windows platforms.

To run this cmdlet, start PowerShell by using the **Run as administrator** option.

Like the other `*-Service` cmdlets, this command doesn't have a **ComputerName** parameter. To use
this command on a remote computer, use the `Invoke-Command` to target a remote system.

## RELATED LINKS

[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md)

[Get-Service](Get-Service.md)

[Restart-Service](Restart-Service.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 09/03/2024
ms.date: 02/04/2026
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/restart-service?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Restart-Service
Expand Down Expand Up @@ -269,8 +269,13 @@ This cmdlet is only available on Windows platforms.
The service names appear in the **Name** column, and the display names appear in the
**DisplayName** column.

Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use
this command on a remote computer, use the `Invoke-Command` to target a remote system.

## RELATED LINKS

[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md)

[Get-Service](Get-Service.md)

[New-Service](New-Service.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 12/12/2022
ms.date: 02/04/2026
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/resume-service?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Resume-Service
Expand Down Expand Up @@ -247,8 +247,13 @@ This cmdlet is only available on Windows platforms.
The service names appear in the **Name** column, and the display names appear in the
**DisplayName** column.

Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use
this command on a remote computer, use the `Invoke-Command` to target a remote system.

## RELATED LINKS

[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md)

[Get-Service](Get-Service.md)

[New-Service](New-Service.md)
Expand Down
32 changes: 19 additions & 13 deletions reference/7.4/Microsoft.PowerShell.Management/Set-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 03/20/2024
ms.date: 02/04/2026
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/set-service?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Set-Service
Expand Down Expand Up @@ -224,18 +224,19 @@ SQLWriter Automatic

### -Credential

Specifies the account used by the service as the [Service Logon Account](/windows/desktop/ad/about-service-logon-accounts).
Specifies the account used by the service as the
[Service Logon Account](/windows/desktop/ad/about-service-logon-accounts).

Type a user name, such as **User01** or **Domain01\User01**, or enter a **PSCredential** object,
such as one generated by the `Get-Credential` cmdlet. If you type a user name, this cmdlet prompts
you for a password.

Credentials are stored in a [PSCredential](/dotnet/api/system.management.automation.pscredential)
object and the password is stored as a [SecureString](/dotnet/api/system.security.securestring).
Credentials are stored in a [PSCredential](xref:System.Management.Automation.PSCredential) object
and the password is stored as a [SecureString](xref:System.Security.SecureString).

> [!NOTE]
> For more information about **SecureString** data protection, see
> [How secure is SecureString?](/dotnet/api/system.security.securestring#how-secure-is-securestring).
> [How secure is SecureString?](xref:System.Security.SecureString#how-secure-is-securestring).

This parameter was introduced in PowerShell 6.0.

Expand Down Expand Up @@ -390,14 +391,14 @@ Specifies the start mode of the service.

The acceptable values for this parameter are as follows:

- **Automatic** - The service is started or was started by the operating system, at system start-up.
- `Automatic` - The service is started or was started by the operating system, at system start-up.
If an automatically started service depends on a manually started service, the manually started
service is also started automatically at system startup.
- **AutomaticDelayedStart** - Starts shortly after the system boots.
- **Disabled** - The service is disabled and cannot be started by a user or application.
- **InvalidValue** - Has no effect. The cmdlet does not return an error but the StartupType of the
- `AutomaticDelayedStart` - Starts shortly after the system boots.
- `Disabled` - The service is disabled and cannot be started by a user or application.
- `InvalidValue` - Has no effect. The cmdlet does not return an error but the StartupType of the
service is not changed.
- **Manual** - The service is started only manually, by a user, using the Service Control Manager,
- `Manual` - The service is started only manually, by a user, using the Service Control Manager,
or by an application.

```yaml
Expand All @@ -419,9 +420,9 @@ Specifies the status for the service.

The acceptable values for this parameter are as follows:

- **Paused**. Suspends the service.
- **Running**. Starts the service.
- **Stopped**. Stops the service.
- `Paused`. Suspends the service.
- `Running`. Starts the service.
- `Stopped`. Stops the service.

```yaml
Type: System.String
Expand Down Expand Up @@ -507,8 +508,13 @@ a command doesn't work correctly, you might not have the required permissions.
To find a service's service name or display name, use `Get-Service`. The service names are in the
**Name** column and the display names are in the **DisplayName** column.

Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use
this command on a remote computer, use the `Invoke-Command` to target a remote system.

## RELATED LINKS

[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md)

[Get-Service](Get-Service.md)

[New-Service](New-Service.md)
Expand Down
15 changes: 11 additions & 4 deletions reference/7.4/Microsoft.PowerShell.Management/Start-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 10/15/2024
ms.date: 02/04/2026
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/start-service?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
aliases:
Expand Down Expand Up @@ -92,9 +92,10 @@ existing file.

This example shows how to start a service when the start type of the service is **Disabled**.

```
```powershell
PS> Start-Service tlntsvr
Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the following error: Cannot start service TlntSvr on computer '.'.
Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the following error: Cannot
start service TlntSvr on computer '.'.
At line:1 char:14
+ Start-Service <<<< tlntsvr

Expand Down Expand Up @@ -256,7 +257,8 @@ Accept wildcard characters: False

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand Down Expand Up @@ -303,8 +305,13 @@ This cmdlet is only available on Windows platforms.
work to do. When PowerShell starts a service that stops itself almost immediately, it displays the
following message: `Service \<display-name\> start failed.`

Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use
this command on a remote computer, use the `Invoke-Command` to target a remote system.

## RELATED LINKS

[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md)

[Get-Service](Get-Service.md)

[New-Service](New-Service.md)
Expand Down
13 changes: 9 additions & 4 deletions reference/7.4/Microsoft.PowerShell.Management/Stop-Service.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Management
ms.date: 01/27/2023
ms.date: 02/04/2026
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/stop-service?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
aliases:
Expand Down Expand Up @@ -51,15 +51,15 @@ to stop.

### Example 1: Stop a service on the local computer

```
```powershell
PS C:\> Stop-Service -Name "sysmonlog"
```

This command stops the Performance Logs and Alerts (SysmonLog) service on the local computer.

### Example 2: Stop a service by using the display name

```
```powershell
PS C:\> Get-Service -DisplayName "telnet" | Stop-Service
```

Expand All @@ -69,7 +69,7 @@ an object that represents the Telnet service. The pipeline operator (`|`) pipes

### Example 3: Stop a service that has dependent services

```
```powershell
PS C:\> Get-Service -Name "iisadmin" | Format-List -Property Name, DependentServices
PS C:\> Stop-Service -Name "iisadmin" -Force -Confirm
```
Expand Down Expand Up @@ -297,8 +297,13 @@ To find the service names and display names of the services on your system, type
service names appear in the **Name** column and the display names appear in the **DisplayName**
column.

Beginning in PowerShell 6.0, the command no longer includes the **ComputerName** parameter. To use
this command on a remote computer, use the `Invoke-Command` to target a remote system.

## RELATED LINKS

[Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md)

[Get-Service](Get-Service.md)

[New-Service](New-Service.md)
Expand Down
Loading
Loading