Contact Info

Crumbtrail

ActiveXperts.com » 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.

Set-Service

Description
Change the start mode/properties of a service

Usage


Options
-name
       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

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

   -confirm
       Prompt for confirmation before executing the command.

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

Example(s)
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"}