Optimize-WsusServer icon indicating copy to clipboard operation
Optimize-WsusServer copied to clipboard

HTTP requests fail when SSL is required

Open culorsung opened this issue 4 months ago • 0 comments

Running anything that interacts with WSUS (invoke-wsusservercleanup, get-wsusclassification, etc) when SSL is required results in an error like this:

Get-WsusClassification : The request failed with HTTP status 400: Bad Request.
At C:\optimize-wsus.ps1:827 char:5
+     Get-WsusClassification | Where-Object -FilterScript {$_.Classific ...
+     ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Updat...ficationCommand:GetWsusClassificationCommand) [Get-WsusClassification], WebException
    + FullyQualifiedErrorId : ServerIsInvalid,Microsoft.UpdateServices.Commands.GetWsusClassificationCommand

Adding something like this to these lines resolves it, but that doesn't feel like the best solution:

Get-WsusServer -UseSsl -Name <fqdn> -PortNumber 8531 | <command>

Am I missing something, or should I figure out a way to make this happen dynamically?

Thanks!

culorsung avatar Dec 01 '25 18:12 culorsung