Test-OutlookWebServices PowerShell command fails

We are running Exchange 2010 currently in hybrid mode with Office 365.  When I try to run this command...

Test-OutlookWebServices -identity:johndoe@mydomain.com | ft * -AutoSize -Wrap

I get an error saying "object reference not set to an instance of the object."  What am I doing wrong?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are you running the command on exchange server? Also can you post the complete error or screenshot?
bpl5000Author Commented:
Yes, ran the command on our exchange server.  The complete error is...

WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance
 of an object.
Object reference not set to an instance of an object.
    + CategoryInfo          : NotSpecified: (:) [Test-OutlookWebServices], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Exchange.Management.SystemConfigurationTasks.Tes
Does it gives error for all users?
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

The error sounds to me like something may not be correctly installed or configured.  Do you get the same error is you try from another management console?   Is there a corresponding error in the event log?   Where does the id reside on-prem or O365?
bpl5000Author Commented:
The user is on O365.  There is a remote mailbox entry in the Mail Contact section of EMC so I thought that wold suffice.  Maybe I need to run this in the Azure AD powershell?  I tried that and I get the error that the command is not recognized as the name of a cmdlet.
I don't think the command Test-OutlookWebServices applies to exchange online.. Check Applies to: section from the references..


Does the command work well for your local exchange mailboxes?
bpl5000Author Commented:
We are in hybrid mode and I'm trying to test AutoDiscovery which is done from our Exchange 2010 SP3 server.  Microsoft has website for testing AutoDiscovery, but you have to provide the user's password.  I can test it for myself, but not other users.  Does anyone know another way to test AutoDiscover?
You need the MOSDAL or Microsoft Remote Connectivity Analyzer to test/troubleshoot the autodiscover for exchange online (Yes you need the user credential to test it).

There are third party function like Test-Autodiscover available to test this using PowerShell. but you still need to enter the user credentials.
Ref : http://www.mikepfeiffer.net/2011/08/testing-exchange-autodiscover-with-powershell-and-the-ews-managed-api/

AFIK, If you want to use your account to test the autodiscover on behalf of user then your account should have permission to impersonate the user and perform operations by using the user's identity.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.