Skip to content

[Issue] - Health Checker - Throwing 'Value does not fall within the expected range' #2505

@dpaulson45

Description

@dpaulson45

Provide Version Number
Exchange Health Checker version 25.11.03.1806

Describe the issue
When using jobs, we fail to complete the script due to Invoke-JobExchangeInformationLocal when trying to return the job throws Value does not fall within the expected range. Then if you use -ForceLegacy the script will complete, but then fail to export the data with Export-Clixml with the same exception.

Expected behavior
The script should complete and handle the errors.

Script Output

----Errors that occurred that wasn't handled----
[01/18/2026 18:55:41] : Error Index: 0
[01/18/2026 18:55:41] : 

----------------Error Information----------------
Error Origin Info: ExchangeServer.contoso.com
 : Value does not fall within the expected range.
Inner Exception: System.Management.Automation.RemoteException: Value does not fall within the expected range.
Position Message: At C:\HealthChecker.ps1:11061 char:25
+ ...             $result = Receive-Job $jobInfo.Job -ErrorVariable "JobErr ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remote Position Message: At line:3164 char:9
+         [PSCustomObject]@{
+         ~~~~~~~~~~~~~~~~~~
Script Stack: at Invoke-JobExchangeInformationLocal<End>, <No file>: line 3164
at <ScriptBlock>, <No file>: line 3186
-------------------------------------------------
----Errors that occurred that wasn't handled----
[01/25/2026 19:03:43] : Error Index: 0
[01/25/2026 19:03:43] : 

----------------Error Information----------------
Export-Clixml : Value does not fall within the expected range.
Inner Exception:    at Microsoft.IIs.PowerShell.Framework.Interop.IAppHostProperty.get_Value()
   at Microsoft.IIs.PowerShell.Framework.ConfigurationElement.GetPropertyValue(IAppHostProperty property)
   at Microsoft.IIs.PowerShell.Framework.ConfigurationAttribute.GetExtendedPropertyValue(ConfigurationAttribute prop, Int64 timeOut)
   at Microsoft.IIs.PowerShell.Framework.CodeProperty.get_Value()
   at System.Management.Automation.SerializationUtilities.GetPropertyValueInThreadSafeManner(PSPropertyInfo property, Boolean canUseDefaultRunspaceInThreadSafeManner, Boolean& success)
   at System.Management.Automation.InternalSerializer.WriteMemberInfoCollection(IEnumerable`1 me, Int32 depth, Boolean writeEnclosingMemberSetElementTag)
   at System.Management.Automation.InternalSerializer.SerializeExtendedProperties(PSObject source, Int32 depth, IEnumerable`1 specificPropertiesToSerialize)
   at System.Management.Automation.InternalSerializer.HandleComplexTypePSObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteOneObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteEnumerable(IEnumerable enumerable, String tag, Int32 depth)
   at System.Management.Automation.InternalSerializer.HandleKnownContainerTypes(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteOneObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteMemberInfoCollection(IEnumerable`1 me, Int32 depth, Boolean writeEnclosingMemberSetElementTag)
   at System.Management.Automation.InternalSerializer.SerializeExtendedProperties(PSObject source, Int32 depth, IEnumerable`1 specificPropertiesToSerialize)
   at System.Management.Automation.InternalSerializer.HandleComplexTypePSObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteOneObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteEnumerable(IEnumerable enumerable, String tag, Int32 depth)
   at System.Management.Automation.InternalSerializer.HandleKnownContainerTypes(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteOneObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteMemberInfoCollection(IEnumerable`1 me, Int32 depth, Boolean writeEnclosingMemberSetElementTag)
   at System.Management.Automation.InternalSerializer.SerializeExtendedProperties(PSObject source, Int32 depth, IEnumerable`1 specificPropertiesToSerialize)
   at System.Management.Automation.InternalSerializer.HandleComplexTypePSObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteOneObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteMemberInfoCollection(IEnumerable`1 me, Int32 depth, Boolean writeEnclosingMemberSetElementTag)
   at System.Management.Automation.InternalSerializer.SerializeExtendedProperties(PSObject source, Int32 depth, IEnumerable`1 specificPropertiesToSerialize)
   at System.Management.Automation.InternalSerializer.HandleComplexTypePSObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteOneObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteMemberInfoCollection(IEnumerable`1 me, Int32 depth, Boolean writeEnclosingMemberSetElementTag)
   at System.Management.Automation.InternalSerializer.SerializeExtendedProperties(PSObject source, Int32 depth, IEnumerable`1 specificPropertiesToSerialize)
   at System.Management.Automation.InternalSerializer.HandleComplexTypePSObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteOneObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteEnumerable(IEnumerable enumerable, String tag, Int32 depth)
   at System.Management.Automation.InternalSerializer.HandleKnownContainerTypes(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteOneObject(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteDictionary(IDictionary dictionary, String tag, Int32 depth)
   at System.Management.Automation.InternalSerializer.HandleKnownContainerTypes(Object source, String streamName, String property, Int32 depth)
   at System.Management.Automation.InternalSerializer.WriteOneObject(Object source, String streamName, String property, Int32 depth)
   at Microsoft.PowerShell.Commands.ExportClixmlCommand.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
Position Message: At C:\HealthChecker.ps1:537 char:31
+ ...            Get-DebugObject | Export-Clixml -Encoding utf8 -Path $path
+                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Script Stack: at Get-DebugObject<Process>, C:\HealthChecker.ps1: line 465
at Write-ScriptDebugObject, C:\HealthChecker.ps1: line 537
at Get-ErrorsThatOccurred, C:\HealthChecker.ps1: line 546
at <ScriptBlock><End>, C:\HealthChecker.ps1: line 21139
at <ScriptBlock>, <No file>: line 1
-------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions