Start, Stop, and Restart Windows Services from Mac OS X

Sep 8, 2010 - Leave a Comment

restart windows services mac os x

Mac OS X includes Samba support by default, which allows for communication between OS X and Windows PC hardware. SMB is what enables simple Mac to Windows file sharing, but you can also go further and utilize the command line of OS X or Linux to remotely monitor, start, and stop services running on Windows machines – right from the terminal.

Do note that some Mac OS X versions will need to have Samba Tools installed separately to be able to run the ‘net rpc’ commands as instructed here. You can install samba with homebrew or MacPorts as needed.

This is really handy if you have a multi-OS environment network, and sysadmins should enjoy the ability remotely restart and monitor services running on a Windows machine without leaving OS X Terminal.

Listing Services Running on Windows PC from OS X Command Line

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 targeting the Windows PC at with login Windows and password MyPassword:

net rpc service list -I -U Windows%myPassword

Stopping & Starting Windows Services from the Mac Using net rpc from the Command Line

After identifying the service you want to stop, start, or restart, you can issue the following command to stop the service:


Then you can restart (or start) the service by using the following command:


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.


Related articles:

Posted by: David Mendez in Command Line, Mac OS, Tips & Tricks

Leave a Reply


Shop on and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks


iPhone / iPad



Shop on Amazon to help support this site