-The easiest way to restart or shutdown Windows machine when doing remote desktop just press alt + F4
-Another way by type shutdown command in command prompt
Example command to restart in 5 seconds:
shutdown -t 5 -r -f
Example command to shutdown in 5 seconds:
shutdown -t 5 -s -f