最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

powershell - Cannot Bind RDP to Specific Certificate on Windows Server – "Invalid Namespace" Error with WMIC -

programmeradmin4浏览0评论

I am trying to configure Remote Desktop (RDP) on my Windows Server to use a specific certificate, but the system keeps using a self-signed certificate instead. I want to bind RDP to a certificate that I have installed in Remote Desktop → Certificates in certlm.msc.

What I Tried:

  1. Checked which certificate is currently in use:

    Get-WmiObject -Namespace "Root\CIMV2\TerminalServices" -Class Win32_TSGeneralSetting | Select-Object TerminalName, SSLCertificateSHA1Hash

    • Output shows that RDP is using a self-signed certificate.
  2. Attempted to set the correct certificate using WMIC (via Powershell with Administrator rights):

    wmic /namespace:\root\CIMV2\TerminalServices PATH Win32_TSGeneralSetting Set SSLCertificateSHA1Hash="b071217ae12bc2aa5ec0256d4e24c6ce60071a46"

    • Error: "Invalid namespace"
  3. Manually checked certlm.msc and confirmed that the certificate I want to use is installed under Remote Desktop → Certificates and issued by a trusted CA.

  4. Tried setting the certificate via PowerShell:

    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name SSLCertificateSHA1Hash -Value "b071217ae12bc2aa5ec0256d4e24c6ce60071a46" Restart-Service TermService -Force

    • After running this, I checked again, but RDP is still using the wrong certificate.

What I Need Help With:

  • Why is WMIC returning "Invalid namespace" when trying to set the certificate?

  • How can I force RDP to use the correct certificate that is already installed?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论