Thursday, September 09, 2010

David Mendez: Start, Stop, and Restart Windows Services from Mac OS X

Innen.

Mac OS X includes Samba support by default, and this is really handy if you’d like to remotely restart and monitor services running on a Windows machine.

To list services running on the Windows machine, use this command:
net rpc service list -I IPADDRESS -U USERNAME%PASSWORD
A practical example would be:
net rpc service list -I 192.168.0.115 -U Windows%myPassword

After identifying the service you want to restart, you issue the following command to stop the service:
net rpc service stop SERVICENAME -I IPADDRESS -U USERNAME%PASSWORD

Then you can restart (or start) the service by using the following command:
net rpc service start SERVICENAME -I IPADDRESS -U USERNAME%PASSWORD

This is tip that I found on Lifehacker that was aimed at Linux users, but considering Mac OS X has a unix underbelly equipped with samba the command works just the same on a Mac.