Skip to content

[Issue] - Health Checker "Getting ExSetup remotely" doesn't find ExSetup.exe #1692

@dpaulson45

Description

@dpaulson45

Describe the issue
A few different customers have had issues with Health Checker failing due to unable to find ExSetup.exe on the server.

Expected behavior
Properly handle trying to find ExSetup.exe and not error out. Then fall back to using the Admin Display version from Get-ExchangeServer

Script Output

Calling: Get-ExSetupDetails
Calling: Invoke-ScriptBlockHandler
Description: Getting ExSetup remotely
Running Invoke-Command without argument list
Exiting: Invoke-ScriptBlockHandler
Exiting: Get-ExSetupDetails
Calling: Get-ExchangeBuildVersionInformation
Unknown version of Exchange is detected.
Can't lookup when keys aren't set
Determined Build Version 
Calling: Get-ServerRole
Roll: ClientAccess
Failed to Health Checker against ServerName


--------

Errors that occurred that wasn't handled
Error Index: 0
Get-ExchangeUpdates : Cannot validate argument on parameter 'ExchangeMajorVersion'. The argument "" does not belong to the set "Exchange2013,Exchange2016,Exchange2019" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
Inner Exception:    at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
   at System.Management.Automation.CmdletParameterBinderController.BindParameter(CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
   at System.Management.Automation.CmdletParameterBinderController.BindParameter(UInt32 parameterSets, CommandParameterInternal argument, MergedCompiledCommandParameter parameter, ParameterBindingFlags flags)
   at System.Management.Automation.CmdletParameterBinderController.BindParameters(UInt32 parameterSets, Collection`1 arguments)
   at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParametersNoValidation(Collection`1 arguments)
   at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)
   at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
   at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)
   at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
Position Message: At C:\HealthChecker.ps1:10785 char:100
+ ... geMajorVersion $versionInformation.MajorVersion)
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Script Stack: at Get-ExchangeInformation<Process>, C:\HealthChecker.ps1: line 10779
at Get-HealthCheckerExchangeServer<Process>, C:\HealthChecker.ps1: line 12480
at Get-HealthCheckerData, C:\HealthChecker.ps1: line 13208
at Invoke-HealthCheckerMainReport, C:\HealthChecker.ps1: line 13284
at <ScriptBlock><End>, C:\HealthChecker.ps1: line 14042
at <ScriptBlock>, <No file>: line 1
-----------------------------------

Additional context

If script is run locally, we don't run Invoke-Command and are able to get this error context as well.

Get-Command : The term 'ExSetup' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Inner Exception: System.Management.Automation.CommandNotFoundException: The term 'ExSetup' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Position Message: At C:\HealthChecker.ps1:10585 char:9
+         Get-Command ExSetup | ForEach-Object { $_.FileVersionInfo }
+         ~~~~~~~~~~~~~~~~~~~
Script Stack: at Get-ExSetupDetailsScriptBlock, C:\HealthChecker.ps1: line 10585
at Invoke-ScriptBlockHandler<Process>, C:\HealthChecker.ps1: line 506
at Get-ExSetupDetails, C:\HealthChecker.ps1: line 10588
at Get-ExchangeInformation<Process>, C:\HealthChecker.ps1: line 10776
at Get-HealthCheckerExchangeServer<Process>, C:\HealthChecker.ps1: line 12480
at Get-HealthCheckerData, C:\HealthChecker.ps1: line 13208
at Invoke-HealthCheckerMainReport, C:\HealthChecker.ps1: line 13284
at <ScriptBlock><End>, C:\HealthChecker.ps1: line 14042
at <ScriptBlock>, <No file>: line 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions