PSM Certificate Renewal Fails with WMI "Invalid Class" and RDP Error 0x904
Symptom
When attempting to bind a newly renewed RDS certificate on a standalone PSM server, administrators may encounter two sequential issues:
1. Symptom 1 (WMI Block): Attempting to bind the certificate using standard PowerShell WMI commands fails with the following error:
Get-WmiObject : Invalid class "Win32_TSGeneralSetting"
2. Symptom 2 (RDP Connection Drop): If the certificate thumbprint is bound successfully via the Windows Registry (bypassing WMI), subsequent RDP connections to the PSM drop immediately with the following error message:
Error code: 0x904
Extended error code: 0x7
Environment
14.1 Privilege Cloud Privilege Cloud PSM
- Idira Privilege Cloud
- Idira Core PAS
- Privileged Session Manager (PSM)
- Standalone RD Session Host (No RDS Deployment GUI available)
Cause
1. WMI Error: Standard Idira PSM hardening heavily restricts WMI namespaces to prevent enumeration. This prevents PowerShell from accessing the TerminalServices class required to update the RDP-Tcp listener.
2. 0x904 Error: This error occurs when the Remote Desktop Service (TermService) attempts to establish the TLS tunnel but is denied access to read the new certificate's Private Key.
Resolution
To resolve this issue, you must manually grant the necessary permissions to the certificate's private key and then use a PowerShell script to bypass the WMI restrictions via the Windows Registry.
Step 1: Grant Private Key Permissions
Before binding the certificate, the NETWORK SERVICE account must be granted Read access to the private key.
1. Log into the PSM and open mmc.exe.
2. Add the Certificates (Local Computer) snap-in and navigate to Personal > Certificates.
3. Right-click the newly imported certificate, then select All Tasks > Manage Private Keys...
4. Click Add..., type NETWORK SERVICE, and click OK.
5. Ensure the Read permission is checked for the NETWORK SERVICE account, then click Apply and OK.
Step 2: Bind the Certificate via Registry (WMI Bypass)
Run the following PowerShell script As Administrator to convert the certificate thumbprint into a byte array and inject it directly into the RDP-Tcp registry key.
Step 3: Verification
Initiate a standard RDP session (mstsc.exe) directly to the PSM node to verify the certificate warning is cleared and the connection succeeds without dropping.