Using the command line tool:
TFSServiceControl [quiesce|unquiesce]
You can use the TFSServiceControl command to stop or start all of the services and application pools Visual Studio Team Foundation Server uses. For example, you use this command when backing up or restoring databases, or when you are moving your deployment from one machine to another.
Source: http://msdn.microsoft.com/en-us/library/ff470382.aspx
How to stop and resume all TFS services
How to stop and resume all TFS services