Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Using Microsoft.Xrm.Tooling.CrmConnector.Powershell with two factor authentication

Posted on by

Hi all,

I have a problem connecting to CRM using powershell.

I've followed "Use PowerShell cmdlets for XRM tooling to connect to Dynamics 365" (msdn.microsoft.com/.../dn689040.aspx)  to install powershell extensions. I'm using -InteractiveMode to get connection control.

   Get-CrmConnection -InteractiveMode

shows me the regular connect to CRM control. When I enter login/password in Office365 - it shows an error with the text in log:

Error	: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.

The problem is that I have 2 factor authentication setup in this environment.

If I try to connect to CRM using PluginRegistrationTool (which I believe uses same Microsoft.Xrm.Tooling.CrmConnectControl) once I enter the credentials - I get a popup window that asks me once again to register with Microsoft and then send me the code on the phone.

What can I do to make two-factor authentication work in Powershell? 

*This post is locked for comments

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans