python wmic_wmic linux python

sudo aptitude install wmi-client

Example of usage is;

wmic -U DOMAIN/administrator%password //10.99.92.9 “Select * from Win32_Service”

Lists all services, the first line it spits back is the fields which you can use this SQL like language  to filter, so to see only the names of the services installed we’d do:

wmic -U DOMAIN/administrator%password //10.99.92.9 “Select Name from Win32_Service”

Or Name and State:

wmic -U DOMAIN/administrator%password //10.99.92.9 “Select Name,State from Win32_Service”

Or for just one service in this case the UPS service:

wmic -U DOMAIN/administrator%password //10.99.92.9 “Select Name,State from Win32_Service where name=’UPS'”

The language for the queries is called WQL and a reference is available here over at MSDN.

Hope this helps, this is only in Hardy as far as I’m aware.

http://stackoverflow.com/questions/20115578/access-wmi-via-python-from-linux

http://blog.csdn.net/wqiancangq/article/details/54575003

https://github.com/kanzure/python-wmi-client-wrapper

http://www.krenger.ch/blog/wmi-commands-from-linux/

https://pypi.python.org/pypi/wmi-client-wrapper

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值