Friday, January 31, 2014

To restart a windows service from Linux server

To restart a windows service from Linux server follow the below reference link(s):

http://lifehacker.com/5575671/restart-windows-services-from-your-linux-pc
http://www.lylebackenroth.com/blog/2010/06/29/manage-windows-remotely-from-a-linux-command-line-interface/
http://monitoringtt.blogspot.in/2013/02/restarting-windows-services-from-linux.html

example as below:

[root@sserver-nag-cent-d1 ~]# net rpc service stop bits -I sserver-tst-slp1.server.com -U server/username%password
..
bits service is stopped.
[root@xxxxxxx ~]# wmic -U DomainName/Username%Password //ServerName.com "select name,state from Win32_Service where Name='bits'"
CLASS: Win32_Service
Name|State
BITS|Stopped
[root@xxxxxxx ~]# net rpc service start bits -I ServerName.com -U DomainName/Username%Password
.
Successfully started service: bits
[root@xxxxxxx ~]# wmic -U DomainName/Username%Password //ServerName.com "select name,state from Win32_Service where Name='bits'"
CLASS: Win32_Service
Name|State
BITS|Running