remote query windows service

I often need to query Windows Service info, and often I don’t want to log into the client or server machine to do my work. Luckily the Windows SC command (I’m not sure how far back in the Windows OS history this exists, but I know it is available in XP and 2003) works both locally and remotely. Below are some examples.

 

This procedure will show you how to query information about a a Windows Service.

 

The command can be run locally or be pointed to a remote machine for which you have admin privs.

 

Get a list of Services that are running:

Y:/>sc //2qds941 query type= service | find "SERVICE_NAME"

SERVICE_NAME: AudioSrv

SERVICE_NAME: Automatic LiveUpdate Scheduler

SERVICE_NAME: BESClient

SERVICE_NAME: CactusXMBService

SERVICE_NAME: ccEvtMgr

SERVICE_NAME: ccProxy

SERVICE_NAME: ccSetMgr

 

Follow up:

 

Get a list of Services that are not running:

Y:/>sc //2qds941 query type= service state= inactive | find "SERVICE_NAME"

SERVICE_NAME: Alerter

SERVICE_NAME: ALG

SERVICE_NAME: AppMgmt

SERVICE_NAME: aspnet_state

SERVICE_NAME: BITS

SERVICE_NAME: Browser

 

Get a list of all Services:

Y:/>sc //2qds941 query type= service state= all | find "SERVICE_NAME"

SERVICE_NAME: Alerter

SERVICE_NAME: ALG

SERVICE_NAME: AppMgmt

SERVICE_NAME: aspnet_state

SERVICE_NAME: AudioSrv

SERVICE_NAME: Automatic LiveUpdate Scheduler

SERVICE_NAME: BESClient

 

Get a more detailed list of all Services:

Y:/>sc //2qds941 query type= service state= all | find /V "0x"

 

SERVICE_NAME: Alerter

DISPLAY_NAME: Alerter

TYPE : 20 WIN32_SHARE_PROCESS

STATE : 1 STOPPED

(NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)

 

SERVICE_NAME: ALG

DISPLAY_NAME: Application Layer Gateway Service

TYPE : 10 WIN32_OWN_PROCESS

STATE : 1 STOPPED

(NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)

 

SERVICE_NAME: AppMgmt

DISPLAY_NAME: Application Management

TYPE : 20 WIN32_SHARE_PROCESS

STATE : 1 STOPPED

(NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)

 

Get detailed information on the configuration of specified service:

Y:/>sc //2qds941 qc MyService

[SC] GetServiceConfig SUCCESS

 

SERVICE_NAME: MyService

TYPE : 10 WIN32_OWN_PROCESS

START_TYPE : 2 AUTO_START

ERROR_CONTROL : 1 NORMAL

BINARY_PATH_NAME : "C:/MyService/MySerice.exe"

LOAD_ORDER_GROUP :

TAG : 0

DISPLAY_NAME : MyService

DEPENDENCIES : MSMQ

SERVICE_START_NAME : vssi/ece

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值