Another way
Interesting script.
A friend at work showed me a method to do the same thing by connecting to a remote WinXP or Win2003 machine's registry and then modifying the following key (admin rights required):
HKLM/System/CurrentControlSet/Control/Terminal Server/fDenyTSConnection
Change this DWord value depending on whether you need to disable (1) or enable (0) remote connections to the machine.
I can't confirm for Win2003 servers, but no reboot is required for WinXP machines.
This works well for single units but I can see where the script would come in handy.