Windows, like Mac OS X can be put to sleep, locked or suspended from the command line. To suspend a host you would run the following command:
rundll32 powrprof.dll,SetSuspendState
To lock a Windows computer from the command line, use the following command:
rundll user32.dll,LockWorkStation
To put a machine in Hibernation mode:
rundll32 powrprof.dll,SetSuspendState Hibernate
If you would rather simply shut the computer down, then there is also the shutdown command, which can be issued at the command line. You can also use tsshutdn, which provides a few more options than the traditional shutdown command. All of these commands can also be scripted. For example, using the at command to provide a one time instance (which is actually a feature built into tsshutdn and shutdown). Another way to automate these in WIndows would be to issue the schtasks command (or simply write a batch file and use the GUI).
Tags: hibernate, lockworkstation, powrprof.dll, rundll32, setsuspendstate, sleep from command line, user32.dll, Windows
