Kill a stuck Service

sc queryex [servicename]
taskkill /f /pid [PID]

Replace [servicename] with the services registry name. For example: Print Spooler is spooler.
Replace[PID] with the PID returned from the previous command.

Redircmp / Redirusr

Change the default location for new computers and users so that fresh objects can have GPOs applied (you cannot apply GPOs to the default Containers)

redirusr ou=myusers,DC=contoso,dc=com
redircmp ou=mycomputers,DC=contoso,dc=com


At an Administrative Command Prompt enter “Telnet 389”, where 389 is the port you want to connect to on the host. If you are not sending SMTP you will just get an empty black screen if it works.


Eg. MOVES a folder and sub-directories without waiting and without retrying, strips off the security.
robocopy \\from\this\dir \\to\this\dir /e /zb /copy:DAT /r:0 /w:0 /mov

robocopy "E:\source\subfolder" "Q:\target\subfolder" /e /zb /copy:DAT /r:0 /w:0 /move

Note: if you are going to save this as a batch file, don’t call the batch file Robocopy.bat!
…and watch your speech marks. Word destroys them!

Install Mode on a TS

Before installing anything on a Terminal Server you need to put it into Install Mode, and then Execute Mode once you’ve finished!

change user /install
User session is ready to install applications.

change user /execute
User session is ready to execute applications.