Get-WebBinding PowerShell cmdlet gives "Value does not fall within the expected range" error if any of the bindings use the central certificate store (CCS).

When using the Get-WebBinding PowerShell you may see the error "Value does not fall within the expected range" error  if any of the bindings use the central certificate store (CCS).

Value does not fall within the expected range.
    + CategoryInfo          : NotSpecified: (:) [Select-Object], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.SelectObjectCommand

This error only occurs  if you perform the following locally

Get-WebBinding|SELECT *

The error also occurs if you try and execute the command using a PowerShell remoting session as the object has to be serialized.

Strangely the cmdlet does correctly return all individual properties. The solution when running remotely using C# is to select only the properties you require by calling ExecuteScript and running
Get-WebBinding|SELECT BindingString etc








Comments

Popular posts from this blog

SOLVED: Exchange Online Management PowerShell Connect-ExchangeOnline bug "A window handle must be configured. See https://aka.ms/msal-net-wam#parent-window-handles"

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

get-windowsfeature : The given key was not present in the dictionary