Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Remove the WMIC dependency #682

Open
MichaelGrafnetter opened this issue Aug 1, 2024 · 2 comments
Open

Feature Request: Remove the WMIC dependency #682

MichaelGrafnetter opened this issue Aug 1, 2024 · 2 comments

Comments

@MichaelGrafnetter
Copy link

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
Copy link
Contributor

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

@MichaelGrafnetter
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants