{"id":1541,"date":"2017-05-09T11:06:04","date_gmt":"2017-05-09T18:06:04","guid":{"rendered":"http:\/\/jim-zimmerman.com\/?p=1541"},"modified":"2020-04-01T12:52:39","modified_gmt":"2020-04-01T19:52:39","slug":"remotely-enable-rdp","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=1541","title":{"rendered":"Remotely enable RDP."},"content":{"rendered":"<p>Download <a href=\"https:\/\/technet.microsoft.com\/en-us\/sysinternals\/bb897553.aspx\">psexec.exe<\/a> to run commands remotely on the remote machine.<br \/>\nSee Windows 10 note at the end of this post.<\/p>\n<p>Once installed, run psexec to bring up a command prompt on the remote machine:<br \/>\nC:\\Tools> psexec \\\\remotecomputer cmd<\/p>\n<p>Turn off the firewall:<br \/>\nC:\\Windows\\system32> netsh advfirewall set currentprofile state off<br \/>\nDefault Profiles: AllProfiles, CurrentProfile, DomainProfile, PrivateProfile, or PublicProfile.<\/p>\n<p>Create a rule to allow Remote Desktop through the firewall:<br \/>\nC:\\Windows\\system32> netsh advfirewall firewall set rule group=&#8221;Remote Desktop Access&#8221; new enable=Yes<\/p>\n<p>These netsh commands will return an &#8220;Ok!&#8221; when successful.<\/p>\n<p>Next ensure that the &#8220;Remote Registry&#8221; service is started, so you can modify the registry to enable Remote Desktop:<br \/>\nC:\\Windows\\system32> net start &#8220;Remote Registry&#8221;<\/p>\n<p>Then, from your local machine open regedit and select File\/Connect Network Registry&#8230;<br \/>\nEnter the name or I.P. address of the remote machine.<br \/>\nOnce connected, navigate to &#8220;REMOTEMACHINE\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server&#8221;<br \/>\nThen, double click fDenyTSConnections and change it from a 1 to a 0.<\/p>\n<p>Then, back on your psexec session restart the &#8220;Remote Desktop Services&#8221; service:<br \/>\nC:\\Windows\\system32> net stop &#8220;Remote Desktop Services&#8221;<br \/>\nC:\\Windows\\system32> net start &#8220;Remote Desktop Services&#8221;<\/p>\n<p>Now, you should be able to connect, and still connect after rebooting if you set the &#8220;Remote Desktop Services&#8221; service to Automatic so it starts at boot.<\/p>\n<p>Windows 10 note:<br \/>\nYou can also use REG.EXE to edit the registry from your PSEXEC.EXE session.  This worked well for Windows 10 without needing to enable Remote Administration:<br \/>\nC:\\Windows\\system32> REG ADD &#8220;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server&#8221; \/v fDenyTSConnections \/t REG_DWORD \/d 0 \/f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Download psexec.exe to run commands remotely on the remote machine. See Windows 10 note at the end of this post. Once installed, run psexec to bring up a command prompt on the remote machine: C:\\Tools> psexec \\\\remotecomputer cmd Turn off the firewall: C:\\Windows\\system32> netsh advfirewall set currentprofile state off Default Profiles: AllProfiles, CurrentProfile, DomainProfile, PrivateProfile, [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[447,326,37,446],"class_list":["post-1541","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-psexec","tag-rdp","tag-registry","tag-remote"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1541"}],"version-history":[{"count":5,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1541\/revisions"}],"predecessor-version":[{"id":1803,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1541\/revisions\/1803"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}