web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Bug in configurecrmserversidesync.ps1 - Office 365 credentials aren't valid

(0) ShareShare
ReportReport
Posted on by

I spent half of my Saturday troubleshooting this problem only to learn a bug in the PS script put me on a wild-goose chase. While installing a new on-premises CRM 365 I came to the step to connect it to Exchange Online. When running the configurecrmserversidesync.ps1 script the process failed with the error "Office 365 credentials aren't valid." There's very little documentation on this script so to troubleshoot I had to guess at what logon format the script was expecting. When none of those varying formats worked, I tried many combinations of user permission configurations in Office 365 and continued to get this error. When I was about to throw my keyboard across the room in frustration I looked at the contents of the PS script file and I saw this line: 

if(!(Test-Connection -ComputerName $rootDomainName -Quiet)) { ExitWithError("Office 365 credentials aren’t valid.")

This line determines if the CRM server responds to ping, and if not, throws the error "Office 365 credentials aren't valid.". I enabled the rule in the CRM server firewall that allows ping and the script ran successfully. Literally a 30 second fix that I wasted hours on thanks to Microsoft sloppiness. You wouldn't see this kind of sloppiness from Google. 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Rodger Keesee Profile Picture
    on at

    Ensure you can ping the on-prem CRM server.

  • Joe Woltering Profile Picture
    12,163 on at

    Hi Rodger,

    I'm running into a different issue when trying to run the script. I get to the end and enter in all the relevant info and then I get a message saying that the MSOnlineExtended module for powershell is required but I see no way to install it and there is little to no documentation on this module. It almost appears that it is no longer available. Any ideas?

  • Rodger Keesee Profile Picture
    on at

    Joe,

    It's been almost a year since i did that but I think this page helped me: 

    stackoverflow.com/.../msonline-cant-be-imported-on-powershell-connect-msolservice-error

  • Neal Santin Profile Picture
    106 on at

    There is also another bug in which it checks if the user is a global admin, however this fails if the user is a global admin AND any other admin.

    need to change this line: 

    if(!$msolUserRole -Or $msolUserRole.ObjectId -ne '62e90394-69f5-4237-9190-012177145e10')

    to this: 

    if(!$msolUserRole -Or $msolUserRole.ObjectId -notcontains '62e90394-69f5-4237-9190-012177145e10')

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans