You can temporarily disable users logons to your terminal server with the following commands at the terminal server command prompt
change logon /disable
You can re-enable user logons with
change logon /enable
This command can be run remotely to allow you to firstly connect via a terminal server client session, disable further logons and then perform maintenance, install software etc.