The query-service command queries the status of a Windows service on the local system or a remote system. The query-service command returns the status of the service as a string. Possible return values are:
The command has the following syntax:
query-service -svcName sName [-host hostname] [-user username] [-pass password]
Specifies the name of the service.
(Optional) The name of the remote Windows system.
Default: ""
(Optional) The user name used to log in to the remote Windows system. Unquoted argument tokens are automatically stringified. Prevent automatic quoting for expressions by placing expression code in parenthesis.
Default: ""
The password used to log in to the remote Windows system. Unquoted argument tokens are automatically stringified. Prevent automatic quoting for expressions by placing expression code in parenthesis.
Default: ""
Examples
To query the local Apache service
? query-service -svcName Apache2.2
To query the Microsoft SQL Server service on a remote server REMOTESYS
? query-service -svcName MSSQLSERVER -host REMOTESYS -user admin -pass notsecret
Copyright © 2013 CA. All rights reserved. |
|