How do I shutdown cmd gui of remote desktop?

Hi guys.
I'm trying to shutdown a remote desktop in my network using the command line. How do I shutdown cmd gui remotely and is this possible? The main and remote desktop both have Windows XP 64 bit. Any suggestions would be of great help.
Thank you.
