What version of ArcGIS Server are you using? There is a utility and scripts that us AGSSOM for I think 10.0 and earlier. If 10.1+, you would want to use the AGS admin toolkit
This toolkit can easily be used with python scripts/tools. For example, I am using parts of the toolkit samples to query only those services that are currently running, checking to see if they use the fgdb I need to update, shut those down, update the fgdb, and then start just those services back up. So you can make it stop/start all, or you can do some filtering and stop/start from a list, etc.
Also look at the other threads on this same or similar subject (in no particular order):