Contact Info

Crumbtrail » Administration » Powershell » Powershell 1.0 » Set-Service

Set-Service - Powershell 1.0 CmdLet

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.


Change the start mode/properties of a service


       Service name(s) to change. Wildcards are permitted. 
   -displayName string
       A new display name for the Service. 

   -description string
       A new description for the service.
   -startupType ServiceStartMode
        Change the starting mode of the service: Automatic or Manual or Disabled

       Describe what would happen if you executed the command without
       actually executing the command.

       Prompt for confirmation before executing the command.

       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutVariable.

Set the start type of the sysmonlog service to automatic:

PS C:\>set-service sysmonlog -startuptype automatic

Display the start type of all services on the computer:

PS C:\>get-wmiobject win32_service | format-table Name, StartMode -autosize

Display the start type of the telnet service on the computer:

PS C:\>get-wmiobject win32_service | where {$_.Name -eq "tlntsvr"}