Issues connecting to Office 365 using PowerShell? Check the client firewall

This content is 10 years old. I don't routinely update old blog posts as they are only intended to represent a view at a particular point in time. Please be warned that the information here may be out of date.

I’ve written previously about managing my Office 365 tenant using Windows PowerShell (Microsoft has since provided its own documentation on the topic) but I tried today and found that I couldn’t get a connection.

Every time I tried to create a session, the response came back as:

[ps.outlook.com] Connecting to remote server failed with the following error message : The WinRM client cannot process the request because the server name cannot be resolved. For more information, see the about_Remote_Troubleshooting Help topic.

+ CategoryInfo : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [], PSRemotingTransportExc
eption

+ FullyQualifiedErrorId : PSSessionOpenFailed

Strangely though, it could resolve the server name as nslookup ps.outlook.com told me:

Non-authoritative answer:
Name: pod51000psh.outlook.com
Address: 132.245.1.167
Aliases: ps.outlook.com

Microsoft knowledge base article 2570535 includes steps for troubleshooting Windows PowerShell issues that affect Exchange Online for Office 365 and suggested

This issue occurs if an internal firewall isn’t started or if the Windows Remote Management service isn’t started

I confirmed that WinRM was running and allowing basic authentication but still couldn’t connect.  So I focused on the “internal firewall isn’t started” part.

Sure enough, the issue was Symentec Endpoint Prevention on my corporate laptop.  I used my wife’s PC instead, and connected with no issues at all…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.