{"id":19,"date":"2024-02-20T15:08:11","date_gmt":"2024-02-20T07:08:11","guid":{"rendered":"https:\/\/nds.cool\/?p=19"},"modified":"2024-04-01T10:41:22","modified_gmt":"2024-04-01T02:41:22","slug":"%e6%9b%b4%e6%94%b9%e8%ae%a1%e7%ae%97%e6%9c%ba%e4%b8%8a%e7%9a%84%e8%bf%9c%e7%a8%8b%e6%a1%8c%e9%9d%a2%e7%9a%84%e4%be%a6%e5%90%ac%e7%ab%af%e5%8f%a3","status":"publish","type":"post","link":"https:\/\/blog.wcld.top\/?p=19","title":{"rendered":"\u66f4\u6539\u8ba1\u7b97\u673a\u4e0a\u7684\u8fdc\u7a0b\u684c\u9762\u7684\u4fa6\u542c\u7aef\u53e3"},"content":{"rendered":"<p>\u9002\u7528\u4e8e\uff1aWindows Server 2022\u3001Windows 11\u3001Windows 10\u3001Windows Server 2019\u3001Windows Server 2016<\/p>\n<p>\u901a\u8fc7\u8fdc\u7a0b\u684c\u9762\u5ba2\u6237\u7aef\u8fde\u63a5\u5230\u8ba1\u7b97\u673a\uff08Windows \u5ba2\u6237\u7aef\u6216 Windows Server\uff09\u65f6\uff0c\u8ba1\u7b97\u673a\u4e0a\u7684\u8fdc\u7a0b\u684c\u9762\u529f\u80fd\u4f1a\u901a\u8fc7\u5b9a\u4e49\u7684\u4fa6\u542c\u7aef\u53e3\uff08\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e3a 3389\uff09\u201c\u4fa6\u542c\u201d\u8fde\u63a5\u8bf7\u6c42\u3002 \u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u6ce8\u518c\u8868\u6765\u66f4\u6539 Windows \u8ba1\u7b97\u673a\u4e0a\u7684\u4fa6\u542c\u7aef\u53e3\u3002<\/p>\n<p>\u542f\u52a8\u6ce8\u518c\u8868\u7f16\u8f91\u5668\u3002 \uff08\u5728\u201c\u641c\u7d22\u201d\u6846\u4e2d\u952e\u5165 regedit\u3002\uff09\n\u5bfc\u822a\u5230\u4ee5\u4e0b\u6ce8\u518c\u8868\u5b50\u9879\uff1a<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp<\/code><\/pre>\n<\/div>\n<p>\u67e5\u627e\u7aef\u53e3\u53f7\n\u5355\u51fb\u201c\u7f16\u8f91\u201d&gt;\u201c\u4fee\u6539\u201d\uff0c\u7136\u540e\u5355\u51fb\u201c\u5341\u8fdb\u5236\u201d\u3002\n\u952e\u5165\u65b0\u7aef\u53e3\u53f7\uff0c\u7136\u540e\u5355\u51fb\u201c\u786e\u5b9a\u201d \u3002\n\u5173\u95ed\u6ce8\u518c\u8868\u7f16\u8f91\u5668\uff0c\u7136\u540e\u91cd\u65b0\u542f\u52a8\u8ba1\u7b97\u673a\u3002\n\u4e0b\u6b21\u4f7f\u7528\u8fdc\u7a0b\u684c\u9762\u8fde\u63a5\u8fde\u63a5\u5230\u6b64\u8ba1\u7b97\u673a\u65f6\uff0c\u5fc5\u987b\u952e\u5165\u65b0\u7aef\u53e3\u3002 \u5982\u679c\u6b63\u5728\u4f7f\u7528\u9632\u706b\u5899\uff0c\u8bf7\u786e\u4fdd\u5c06\u9632\u706b\u5899\u914d\u7f6e\u4e3a\u5141\u8bb8\u8fde\u63a5\u5230\u65b0\u7aef\u53e3\u53f7\u3002<\/p>\n<p>\u53ef\u8fd0\u884c\u4ee5\u4e0b PowerShell \u547d\u4ee4\u6765\u67e5\u770b\u5f53\u524d\u7aef\u53e3\uff1a<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>Get-ItemProperty -Path &#039;HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp&#039; -name &quot;PortNumber&quot;<\/code><\/pre>\n<\/div>\n<p>\u4f8b\u5982\uff1a<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>\nPortNumber : 3389\nPSPath : Microsoft.PowerShell.Core\\Registry::HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp\nPSParentPath : Microsoft.PowerShell.Core\\Registry::HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\nPSChildName : RDP-Tcp\nPSDrive : HKLM\nPSProvider : Microsoft.PowerShell.Core\\Registry\n<\/code><\/pre>\n<\/div>\n<p>\u8fd8\u53ef\u8fd0\u884c\u4ee5\u4e0b PowerShell \u547d\u4ee4\u6765\u66f4\u6539 RDP \u7aef\u53e3\u3002 \u5728\u6b64\u547d\u4ee4\u4e2d\uff0c\u6211\u4eec\u4f1a\u5c06\u65b0\u7684 RDP \u7aef\u53e3\u6307\u5b9a\u4e3a 3390\u3002<\/p>\n<p>\u82e5\u8981\u5411\u6ce8\u518c\u8868\u6dfb\u52a0\u65b0\u7684 RDP \u7aef\u53e3\uff1a<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-plain\" data-lang=\"Plain Text\"><code>\n$portvalue = 3390\n\nSet-ItemProperty -Path &#039;HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp&#039; -name &quot;PortNumber&quot; -Value $portvalue\n\nNew-NetFirewallRule -DisplayName &#039;RDPPORTLatest-TCP-In&#039; -Profile &#039;Public&#039; -Direction Inbound -Action Allow -Protocol TCP -LocalPort $portvalue\n\nNew-NetFirewallRule -DisplayName &#039;RDPPORTLatest-UDP-In&#039; -Profile &#039;Public&#039; -Direction Inbound -Action Allow -Protocol UDP -LocalPort $portvalue\n<\/code><\/pre>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>\u9002\u7528\u4e8e\uff1aWindows Server 2022\u3001Windows 11\u3001Windows 10\u3001Windows Server\u2026<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-win"],"_links":{"self":[{"href":"https:\/\/blog.wcld.top\/index.php?rest_route=\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.wcld.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wcld.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wcld.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wcld.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19"}],"version-history":[{"count":1,"href":"https:\/\/blog.wcld.top\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions"}],"predecessor-version":[{"id":20,"href":"https:\/\/blog.wcld.top\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions\/20"}],"wp:attachment":[{"href":"https:\/\/blog.wcld.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wcld.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wcld.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}