To get a list of objects representing the services and their running status:
type: get-service
To get the status of a particular service, type: get-service -name servicename
where, servicename is the short name for the service.
To get the status for a service using its display name, type:
get-service -displayName "displayname"
example: get-service -name wuauserv
get-service -displayName "Automatic Updates"
both the examples will give the same result.
To start, stop, pause and resume services:
To start a service using short names , type: start-service -name servicename
To start a service using display names, type: start-service -displayName "displayname"
To stop a service using short names , type: stop-service -name servicename
To stop a service using display names, type: stop-service -displayName "displayname"
To pause a service using short names , type: suspend-service -name servicename
To pause a service using display names, type: suspend-service -displayName "displayname"
To resume a service using short names , type:resume-service -name servicename
To resume a service using display names, type: resume-service -displayName "displayname"
To restart a service using short names , type: restart-service -name servicename
To restart a service using display names, type: restart-service -displayName "displayname"
To set how a service starts up:
set-service -name servicename -startupType {<automatic>|<manual>|<disabled>}
or
set-service -displayName displayname -startupType {<automatic>|<manual>|<disabled>}
Example: set-service -name wuauserv -startupType manual
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment