webprofusion / certify

Professional ACME Client for Windows. Certificate Management UI, powered by Let's Encrypt and compatible with all ACME v2 CAs. Download from certifytheweb.com
https://certifytheweb.com
Other
1.48k stars 254 forks source link

Feature Request: Remove the WMIC dependency #682

Open MichaelGrafnetter opened 1 month ago

MichaelGrafnetter commented 1 month ago

Hello, the RDP deployment task depends on WMIC.exe, which has been deprecated by Microsoft

image

Although this issue can temporarily be resolved manually installing the WMIC feature, a different approach (e.g. PowerShell + WMI/CIM) is recommended.

image

webprofusion-chrisc commented 1 month ago

Hi @MichaelGrafnetter thanks for raising this issue and we'll look to getting the existing task deprecated and new replacement task added.

MichaelGrafnetter commented 1 month ago

@webprofusion-chrisc You could just maybe modify the RDPListenerService.ps1 file and replace this line:

wmic /namespace:\\root\cimv2\TerminalServices PATH Win32_TSGeneralSetting Set SSLCertificateSHA1Hash="$($result.ManagedItem.CertificateThumbprintHash)"

with the following one:

Get-WmiObject -Class Win32_TSGeneralSetting -Namespace 'root\cimv2\TerminalServices' -Filter 'TerminalName="RDP-Tcp"' |
  Set-WmiInstance -Arguments @{ SSLCertificateSHA1Hash = $result.ManagedItem.CertificateThumbprintHash } -PutType UpdateOnly

It should do the same thing, while not requiring the external wmic.exe tool. I have not tested it though.