Note Other cmdlets might also not work in this scenario.
Additionally, you receive the following error message in PowerShell ISE:
Add-PSSSnapin Microsoft.Exchange.Management.PowerShell.E2010 PS H:\> Test-WebServicesConnectivity -ClientAccessServer <Clinet Access Server Name> ARNING: An unexpected error has occurred and a Watson dump is being generated: Operation is not valid due to the current state of the object. Test-WebServicesConnectivity : Operation is not valid due to the current state of the object.
Also, the following error is logged in the Application log:
Time: - ID: 8 Level: Error Source: MSExchange CmdletLogs Machine: - Message: (PID 12460, Thread 9) Task Test-WebServicesConnectivity throwing unhandled exception: System.InvalidOperationException: Operation is not valid due to the current state of the object. at Microsoft.Exchange.Data.Storage.ExchangePrincipal.get_ServerFullyQualifiedDomainName() at Microsoft.Exchange.Monitoring.TestCasConnectivity.ResetAutomatedCredentialsAndVerify(TestCasConnectivityRunInstance instance) at Microsoft.Exchange.Monitoring.TestCasConnectivity.BuildRunInstanceForSiteMBox(String deviceId) at Microsoft.Exchange.Monitoring.TestCasConnectivity.BuildRunInstances() at Microsoft.Exchange.Monitoring.TestCasConnectivity.InternalProcessRecord() at Microsoft.Exchange.Configuration.Tasks.Task.ProcessRecord().
To work around this issue, open a remote session to an Exchange server by using the following cmdlets at the beginning of the ISE script:
The Exchange cmdlets can be run in the following scenarios:
In Exchange Management Shell on an Exchange server.
In Exchange Management Shell on a computer that has Management Tools installed.
In PowerShell on an Exchange server after the Exchange snap-ins are loaded.
In PowerShell ISE on an Exchange server after the Exchange snap-ins are loaded.
Note Running cmdlets in a local PowerShell instance is not supported in Exchange Server 2010, unless this use is explicitly documented as being required in Exchange Server 2010 TechNet documentation. For more information, see the following Microsoft MSDN article: