We try to scan Exchange 2016 but it doesn't work:
Errorlog:
2023-08-08 10:19:27,799 [177] INFO AssetName:EX1603 AssetUnique:domain\EX1603\1 AssetID:77929 IP:10.x.y.z ScanMethod:Exchange Description:AssetId: 77929 LOGEXCHANGESCANNING DEBUG Scanning for exchange data.
2023-08-08 10:19:27,831 [177] INFO LOGEXCHANGESCANNING DEBUG Connecting using credential 'Server_adm' for target FQDN 'ex1603.domain.loc'.
2023-08-08 10:19:27,833 [177] INFO LOGEXCHANGESCANNING DEBUG Getting connected domain controller for target FQDN 'ex1603.domain.loc'.
2023-08-08 10:19:50,157 [177] INFO LOGEXCHANGESCANNING DEBUG Executing script 'GetConnectedDomainController'.
2023-08-08 10:20:21,736 [177] INFO LOGEXCHANGESCANNING DEBUG Executed script 'GetConnectedDomainController' successfully.
2023-08-08 10:20:21,737 [177] INFO LOGEXCHANGESCANNING DEBUG No domain controller found or task status returned unsuccessful. Trying another script.
2023-08-08 10:20:21,738 [177] INFO LOGEXCHANGESCANNING DEBUG Executing script 'GetConnectedDomainControllerFilterDnsForestNameFirst'.
2023-08-08 10:20:48,809 [177] INFO LOGEXCHANGESCANNING DEBUG Executed script 'GetConnectedDomainControllerFilterDnsForestNameFirst' successfully.
2023-08-08 10:20:48,811 [177] INFO LOGEXCHANGESCANNING DEBUG Domain controller found but task status returned unsuccessful. Last error message: CollectPowerShellClass: The script 1 completed unsuccessfully with errors:
1. System.Management.Automation.RemoteException: You cannot call a method on a null-valued expression..
BUT when I test by Lansweeper.TestTools.App.exe all seems OK:
2023-08-03 08:25:31,465 [1] INFO LOGEXCHANGESCANNING DEBUG Connecting using credential 'Exchange' for target FQDN 'EX1603.domain.loc'.
2023-08-03 08:25:31,526 [1] INFO LOGEXCHANGESCANNING DEBUG Getting the data for target FQDN 'EX1603.domain.loc'.
2023-08-03 08:25:31,565 [1] INFO LOGPOWERSHELLSCANNING DEBUG Remote or Local Runspace: target: EX1603.domain.loc, fqdn: LS.domain.loc name: LS
2023-08-03 08:25:31,566 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:25:31,571 [1] INFO LOGPOWERSHELLSCANNING DEBUG Connect: Attempting to establish a PowerShell connection on EX1603.domain.loc.
2023-08-03 08:25:31,582 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:25:31,582 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:25:31,610 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:25:52,697 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:25:52,698 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:25:52,702 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:25:53,307 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell: Status when connecting to PowerShell on EX1603.domain.loc : Success
2023-08-03 08:25:53,309 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:25:53,315 [1] INFO LOGPOWERSHELLSCANNING DEBUG AddRemoteCredentials: Trying to add the remote credentials and utility class to EX1603.domain.loc.
2023-08-03 08:25:54,119 [1] INFO LOGPOWERSHELLSCANNING DEBUG Invoking the script...
2023-08-03 08:25:54,476 [1] INFO LOGPOWERSHELLSCANNING DEBUG Listing RemoteShell details for target 'EX1603.domain.loc'.
2023-08-03 08:25:54,478 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: ConfirmPreference
2023-08-03 08:25:54,478 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: High
2023-08-03 08:25:54,480 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: DebugPreference
2023-08-03 08:25:54,481 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: SilentlyContinue
2023-08-03 08:25:54,482 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: ErrorActionPreference
2023-08-03 08:25:54,483 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: Continue
2023-08-03 08:25:54,484 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: ProgressPreference
2023-08-03 08:25:54,485 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: Continue
2023-08-03 08:25:54,486 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: VerbosePreference
2023-08-03 08:25:54,487 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: SilentlyContinue
2023-08-03 08:25:54,488 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: WarningPreference
2023-08-03 08:25:54,489 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: Continue
2023-08-03 08:25:54,490 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: InformationPreference
2023-08-03 08:25:54,491 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: SilentlyContinue
2023-08-03 08:25:54,491 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: WhatIfPreference
2023-08-03 08:25:54,492 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: False
2023-08-03 08:25:54,493 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: true
2023-08-03 08:25:54,494 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: AllowRemoteShellAccess
2023-08-03 08:25:54,495 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: 7200000
2023-08-03 08:25:54,496 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: IdleTimeout
2023-08-03 08:25:54,497 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: 2147483647
2023-08-03 08:25:54,498 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: MaxConcurrentUsers
2023-08-03 08:25:54,499 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: 2147483647
2023-08-03 08:25:54,499 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: MaxShellRunTime
2023-08-03 08:25:54,500 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: 2147483647
2023-08-03 08:25:54,501 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: MaxProcessesPerShell
2023-08-03 08:25:54,502 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: 2147483647
2023-08-03 08:25:54,503 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: MaxMemoryPerShellMB
2023-08-03 08:25:54,503 [1] INFO LOGPOWERSHELLSCANNING DEBUG Value: 2147483647
2023-08-03 08:25:54,504 [1] INFO LOGPOWERSHELLSCANNING DEBUG Name: MaxShellsPerUser
2023-08-03 08:25:54,513 [1] INFO LOGPOWERSHELLSCANNING DEBUG Remote or Local Runspace: target: EX1603.domain.loc, fqdn: LS.domain.loc name: LS
2023-08-03 08:25:54,514 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:25:54,514 [1] INFO LOGPOWERSHELLSCANNING DEBUG Connect: Attempting to establish a PowerShell connection on EX1603.domain.loc.
2023-08-03 08:25:54,515 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:25:54,515 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:25:54,517 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:26:15,552 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:26:15,553 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:26:15,557 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:26:16,133 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell: Status when connecting to PowerShell on EX1603.domain.loc : Success
2023-08-03 08:26:16,134 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:26:16,135 [1] INFO LOGPOWERSHELLSCANNING DEBUG AddRemoteCredentials: Trying to add the remote credentials and utility class to EX1603.domain.loc.
2023-08-03 08:26:16,616 [1] INFO LOGPOWERSHELLSCANNING DEBUG Invoking the script...
2023-08-03 08:26:31,225 [1] INFO LOGEXCHANGESCANNING DEBUG Got the data successfully for target FQDN 'EX1603.domain.loc' and script '#GetExchangeServers' - ItemCount: 9
2023-08-03 08:26:31,231 [1] INFO LOGEXCHANGESCANNING DEBUG Parsing Servers.
2023-08-03 08:26:31,255 [1] INFO LOGEXCHANGESCANNING DEBUG Exchange server found for target FQDN 'EX1603.domain.loc'.
2023-08-03 08:26:31,260 [1] INFO LOGPOWERSHELLSCANNING DEBUG Remote or Local Runspace: target: EX1603.domain.loc, fqdn: LS.domain.loc name: LS
2023-08-03 08:26:31,261 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:26:31,261 [1] INFO LOGPOWERSHELLSCANNING DEBUG Connect: Attempting to establish a PowerShell connection on EX1603.domain.loc.
2023-08-03 08:26:31,261 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:26:31,262 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:26:31,264 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:26:52,283 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:26:52,284 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:26:52,286 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:26:52,974 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell: Status when connecting to PowerShell on EX1603.domain.loc : Success
2023-08-03 08:26:52,976 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:26:52,977 [1] INFO LOGPOWERSHELLSCANNING DEBUG AddRemoteCredentials: Trying to add the remote credentials and utility class to EX1603.domain.loc.
2023-08-03 08:26:53,543 [1] INFO LOGPOWERSHELLSCANNING DEBUG Invoking the script...
2023-08-03 08:30:38,071 [1] INFO LOGEXCHANGESCANNING DEBUG Got the data successfully for target FQDN 'EX1603.domain.loc' and script '#GetUsers' - ItemCount: 18061
2023-08-03 08:30:41,536 [1] INFO LOGEXCHANGESCANNING DEBUG Parsing Users.
2023-08-03 08:34:49,783 [1] INFO LOGEXCHANGESCANNING DEBUG 18060 Users found.
2023-08-03 08:34:49,789 [1] INFO LOGPOWERSHELLSCANNING DEBUG Remote or Local Runspace: target: EX1603.domain.loc, fqdn: LS.domain.loc name: LS
2023-08-03 08:34:49,790 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:34:49,791 [1] INFO LOGPOWERSHELLSCANNING DEBUG Connect: Attempting to establish a PowerShell connection on EX1603.domain.loc.
2023-08-03 08:34:49,792 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:34:49,792 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:34:49,795 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:35:10,812 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:35:10,813 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:35:10,816 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:35:11,726 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell: Status when connecting to PowerShell on EX1603.domain.loc : Success
2023-08-03 08:35:11,728 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:35:11,730 [1] INFO LOGPOWERSHELLSCANNING DEBUG AddRemoteCredentials: Trying to add the remote credentials and utility class to EX1603.domain.loc.
2023-08-03 08:35:12,385 [1] INFO LOGPOWERSHELLSCANNING DEBUG Invoking the script...
2023-08-03 08:35:58,560 [1] INFO LOGEXCHANGESCANNING DEBUG Got the data successfully for target FQDN 'EX1603.domain.loc' and script '#GetGroupsUnlimited' - ItemCount: 6884
2023-08-03 08:35:59,147 [1] INFO LOGEXCHANGESCANNING DEBUG Parsing Groups.
2023-08-03 08:36:36,780 [1] INFO LOGEXCHANGESCANNING DEBUG 6883 Groups found.
2023-08-03 08:36:36,788 [1] INFO LOGPOWERSHELLSCANNING DEBUG Remote or Local Runspace: target: EX1603.domain.loc, fqdn: LS.domain.loc name: LS
2023-08-03 08:36:36,793 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:36:36,799 [1] INFO LOGPOWERSHELLSCANNING DEBUG Connect: Attempting to establish a PowerShell connection on EX1603.domain.loc.
2023-08-03 08:36:36,809 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:36:36,814 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:36:36,823 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:36:58,265 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:36:58,278 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:36:58,292 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:36:59,057 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell: Status when connecting to PowerShell on EX1603.domain.loc : Success
2023-08-03 08:36:59,067 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:36:59,068 [1] INFO LOGPOWERSHELLSCANNING DEBUG AddRemoteCredentials: Trying to add the remote credentials and utility class to EX1603.domain.loc.
2023-08-03 08:36:59,582 [1] INFO LOGPOWERSHELLSCANNING DEBUG Invoking the script...
2023-08-03 08:37:54,095 [1] INFO LOGEXCHANGESCANNING DEBUG Got the data successfully for target FQDN 'EX1603.domain.loc' and script '#GetLicensesLicenseUsers' - ItemCount: 20412
2023-08-03 08:37:54,582 [1] INFO LOGEXCHANGESCANNING DEBUG Parsing Licenses.
2023-08-03 08:39:27,278 [1] INFO LOGEXCHANGESCANNING DEBUG 4 Licenses found.
2023-08-03 08:39:27,283 [1] INFO LOGPOWERSHELLSCANNING DEBUG Remote or Local Runspace: target: EX1603.domain.loc, fqdn: LS.domain.loc name: LS
2023-08-03 08:39:27,284 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:39:27,284 [1] INFO LOGPOWERSHELLSCANNING DEBUG Connect: Attempting to establish a PowerShell connection on EX1603.domain.loc.
2023-08-03 08:39:27,285 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:39:27,285 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:39:27,288 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:39:48,310 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 08:39:48,311 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 08:39:48,316 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 08:39:49,100 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell: Status when connecting to PowerShell on EX1603.domain.loc : Success
2023-08-03 08:39:49,102 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 08:39:49,103 [1] INFO LOGPOWERSHELLSCANNING DEBUG AddRemoteCredentials: Trying to add the remote credentials and utility class to EX1603.domain.loc.
2023-08-03 08:39:49,678 [1] INFO LOGPOWERSHELLSCANNING DEBUG Invoking the script...
2023-08-03 10:45:26,655 [1] INFO LOGPOWERSHELLSCANNING DEBUG Remote or Local Runspace: target: EX1603.domain.loc, fqdn: LS.domain.loc name: LS
2023-08-03 10:45:26,656 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 10:45:26,657 [1] INFO LOGPOWERSHELLSCANNING DEBUG Connect: Attempting to establish a PowerShell connection on EX1603.domain.loc.
2023-08-03 10:45:26,658 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 10:45:26,659 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 10:45:26,661 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 10:45:47,675 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Trying to connect to PowerShell on EX1603.domain.loc...
2023-08-03 10:45:47,676 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell Trying to connect to PowerShell on EX1603.domain.loc with user server_adm
2023-08-03 10:45:47,678 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell runspace created, using credentials server_adm
2023-08-03 10:45:48,350 [1] INFO LOGPOWERSHELLSCANNING DEBUG ConnectToPowerShell: Status when connecting to PowerShell on EX1603.domain.loc : Success
2023-08-03 10:45:48,351 [1] INFO LOGPOWERSHELLSCANNING INFORMATIONAL Remote PowerShell session.
2023-08-03 10:45:48,352 [1] INFO LOGPOWERSHELLSCANNING DEBUG AddRemoteCredentials: Trying to add the remote credentials and utility class to EX1603.domain.loc.
2023-08-03 10:45:48,901 [1] INFO LOGPOWERSHELLSCANNING DEBUG Invoking the script...
2023-08-03 10:46:07,303 [1] INFO LOGEXCHANGESCANNING DEBUG Got the data successfully for target FQDN 'EX1603.domain.loc' and script '#GetMobileDevices' - ItemCount: 1948
2023-08-03 10:46:07,584 [1] INFO LOGEXCHANGESCANNING DEBUG Parsing MobileDevices.
2023-08-03 10:46:09,877 [1] INFO LOGEXCHANGESCANNING DEBUG 1947 MobileDevices found.
2023-08-03 10:46:09,880 [1] INFO LOGEXCHANGESCANNING DEBUG Exchange scanned successfully with credential 'server_adm' for target FQDN 'EX1603.domain.loc'.
2023-08-03 10:46:09,881 [1] INFO LOGEXCHANGESCANNING DEBUG Scanning took 8438 seconds for asset FQDN 'EX1603.domain.loc'.