As you probably know for some testing command such as Test-OwaConnectivity or Test-ActiveSyncConnectivity you need to have created TestCasConnectivityUser based upon new-TestCasConnectivityUser.ps1 otherwise you get error like this:
Could not find or sign in with user aaa. If this task is being run without credentials, sign inas a Domain Administrator, and then run Scripts\new-TestCasConnectivityUser.ps1 to verify that the user exists on Mailbox server bbb.
Script new-TestCasConnectivityUser.ps1 can be found and executed by another script (EMS runspace) if you want to use an unattended way:
$TestAcountPassword = "Pa44word+123" $TestAcountPassword = $TestAcountPassword | ConvertTo-SecureString -AsPlainText -Force $ExchPath = (Get-Command exsetup).path $ExchScriptPath = $ExchPath.Substring(0,$ExchPath.IndexOf("bin\"))+"scripts" cd $ExchScriptPath .\new-TestCasConnectivityUser.ps1 -Password $TestAcountPassword