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

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

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Enable function lock for F1-F12 on HP ZBook mobile workstations