{"id":307,"date":"2014-12-09T14:19:41","date_gmt":"2014-12-09T19:19:41","guid":{"rendered":"http:\/\/jackhanington.com\/blog\/?p=307"},"modified":"2015-06-15T13:38:44","modified_gmt":"2015-06-15T17:38:44","slug":"enable-remote-desktop-on-a-remote-windows-server","status":"publish","type":"post","link":"https:\/\/jackhanington.com\/blog\/2014\/12\/09\/enable-remote-desktop-on-a-remote-windows-server\/","title":{"rendered":"Enable Remote Desktop on a Remote Windows Server"},"content":{"rendered":"<p>Scenario: you just finished installing some brand new servers in\u00a0your server racks at the data center. You plugged them into your network, updated them with the latest windows updates and figured that you can finish the rest of the configuration while sitting at your desk at the office. Unfortunately you forgot to enable remote desktop and there is no way to get into the new machines.<\/p>\n<p><a href=\"\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/Doh.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-308\" src=\"\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/Doh.png\" alt=\"Doh\" width=\"566\" height=\"489\" srcset=\"https:\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/Doh.png 566w, https:\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/Doh-300x259.png 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><\/a><\/p>\n<p>Instead of driving all the way back to the data center, you can use these steps to enable remote desktop&#8230; remotely.<\/p>\n<p><strong>Steps<\/strong><\/p>\n<p>First you need to install PsExec from the Microsoft website\u00a0<a href=\"http:\/\/technet.microsoft.com\/en-us\/sysinternals\/bb897553\" target=\"_blank\">http:\/\/technet.microsoft.com\/en-us\/sysinternals\/bb897553<\/a><\/p>\n<p>Extract the zip file, open a command window and cd\u00a0to the newly extracted\u00a0directory. (Ex. I extracted to a folder on my desktop called PSTools. Start&gt;Run&gt;Cmd&gt;&#8221;cd \u00a0C:\\Users\\Developer\\Desktop\\PSTools&#8221;)<\/p>\n<p>Next you need to run the command listed below. Mofidy the command by changing <strong>remoteserver<\/strong> to the IP of the remote server.<\/p>\n<pre>psexec \\\\remoteserver reg add \"hklm\\system\\currentcontrolset\\control\\terminal server\" \/f \/v fDenyTSConnections \/t REG_DWORD \/d 0<\/pre>\n<p><a href=\"\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/remoteregistry.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-309\" src=\"\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/remoteregistry.png\" alt=\"remoteregistry\" width=\"669\" height=\"176\" srcset=\"https:\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/remoteregistry.png 669w, https:\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/remoteregistry-300x78.png 300w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/a><\/p>\n<p>This sets the registry value on the remote machine to enable and disable remote desktop connections.<\/p>\n<p>Now we need to add the firewall exceptions to allow us remote access. Again, modify the commands below by changing <strong>remoteserver<\/strong> to the IP of the machine.<\/p>\n<pre>psexec \\\\remoteserver netsh firewall set service remoteadmin enable\r\npsexec \\\\remoteserver netsh firewall set service remotedesktop enable<\/pre>\n<p><a href=\"\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/netshfirewall.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-310\" src=\"\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/netshfirewall.png\" alt=\"netshfirewall\" width=\"667\" height=\"547\" srcset=\"https:\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/netshfirewall.png 667w, https:\/\/jackhanington.com\/blog\/wp-content\/uploads\/2014\/12\/netshfirewall-300x246.png 300w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><\/a><\/p>\n<p>After running those two commands, you should be able to remote desktop into that machine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scenario: you just finished installing some brand new servers in\u00a0your server racks at the data center. You plugged them into your network, updated them with the latest windows updates and figured that you can finish the rest of the configuration while sitting at your desk at the office. Unfortunately you forgot to enable remote desktop&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[20,3,67,4,54,6],"tags":[118,68,69,13,114,70,115],"class_list":["post-307","post","type-post","status-publish","format-standard","hentry","category-blog","category-information-technology","category-microsoft","category-servers","category-software","category-windows","tag-microsoft","tag-remote","tag-remote-desktop","tag-server","tag-servers","tag-sysinternals","tag-windows"],"_links":{"self":[{"href":"https:\/\/jackhanington.com\/blog\/wp-json\/wp\/v2\/posts\/307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jackhanington.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jackhanington.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jackhanington.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jackhanington.com\/blog\/wp-json\/wp\/v2\/comments?post=307"}],"version-history":[{"count":5,"href":"https:\/\/jackhanington.com\/blog\/wp-json\/wp\/v2\/posts\/307\/revisions"}],"predecessor-version":[{"id":366,"href":"https:\/\/jackhanington.com\/blog\/wp-json\/wp\/v2\/posts\/307\/revisions\/366"}],"wp:attachment":[{"href":"https:\/\/jackhanington.com\/blog\/wp-json\/wp\/v2\/media?parent=307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jackhanington.com\/blog\/wp-json\/wp\/v2\/categories?post=307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jackhanington.com\/blog\/wp-json\/wp\/v2\/tags?post=307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}