Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

Issues with Export-O365Configuration using MFA

Open jfrobichaud opened this issue 7 years ago • 13 comments

Hi, I'm trying to use the Export-O365Configuration command, but my account is using MFA and it is throwing the following error:

Connect-AzureAD : AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access

Connect-AzureAD : Response status code does not indicate success: 400 (BadRequest).

Thanks

jfrobichaud avatar Jul 04 '19 18:07 jfrobichaud

Salut @jfrobichaud !

@brianlala that is one for you buddy

NikCharlebois avatar Jul 04 '19 18:07 NikCharlebois

This is exactly what my recently-merged changes were meant to address... what version of the module are you using @jfrobichaud ?

brianlala avatar Jul 04 '19 19:07 brianlala

@jfrobichaud the changes that @brianlala is refering to were merged into this GitHub repo this morning. If you install the module from the PowerShell Gallery, you won't get those bits. You will need to grab the latest version from GitHub directly. Let me know if you required further assistance with grabbing the latest bits.

NikCharlebois avatar Jul 04 '19 19:07 NikCharlebois

Thanks, login successful now.

jfrobichaud avatar Jul 05 '19 12:07 jfrobichaud

Glad it worked. Will leave open for the day, let me know if you encounter other issues. We are aware of a case where you may get incorrectly prompted for credentials again mid-way through the extraction. We are working on a PR to have this fixed ASAP.

NikCharlebois avatar Jul 05 '19 12:07 NikCharlebois

When I provide my creds, the GUI just disappears. I wonder if this can be updated to support GCC High? Or a branch for GCC High.

wheelerk avatar Dec 03 '19 18:12 wheelerk

@wheelerk in the actually PowerShell console you used to launched the GUI, do you see any verbose output at all? E.g. Extracting O365AdminAuditLogConfig

NikCharlebois avatar Dec 03 '19 20:12 NikCharlebois

No, the cursor just continues to flash. On another note, my GA is MFA enforces. Oh wait, I’m seeing An error log.

Get Outlook for iOShttps://aka.ms/o0ukef

From: Nik Charlebois [email protected] Sent: Tuesday, December 3, 2019 3:04:27 PM To: microsoft/Office365DSC [email protected] Cc: wheelerk [email protected]; Mention [email protected] Subject: Re: [microsoft/Office365DSC] Issues with Export-O365Configuration using MFA (#132)

@wheelerkhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwheelerk&data=02%7C01%7C%7C58ef0ee8e3fd4b22de5e08d7782c00ba%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637110002686459293&sdata=SWcsQ5GQfn%2B8TvxUgQqE%2BPvCf6HxV7aI1lRU52TmWp8%3D&reserved=0 in the actually PowerShell console you used to launched the GUI, do you see any verbose output at all? E.g. Extracting O365AdminAuditLogConfig

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FOffice365DSC%2Fissues%2F132%3Femail_source%3Dnotifications%26email_token%3DAELADMOC6HSCQQWFNOHP7QTQW23UXA5CNFSM4H56KMCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF2UNRA%23issuecomment-561333956&data=02%7C01%7C%7C58ef0ee8e3fd4b22de5e08d7782c00ba%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637110002686459293&sdata=Ci70740zEa%2BaCxSCYKey4T7H9AWazoYeca2TmP%2BlGlY%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAELADMPSXJQ3KKK5YUDHTTDQW23UXANCNFSM4H56KMCA&data=02%7C01%7C%7C58ef0ee8e3fd4b22de5e08d7782c00ba%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637110002686469298&sdata=7Cgt7%2BeiA0PE2bAcOcAR1NBnrCtOlWSxc8fsMTKRMIA%3D&reserved=0.

wheelerk avatar Dec 03 '19 20:12 wheelerk

No, the cursor just continues to flash. On another note, my GA is MFA enforces. Oh wait, I’m seeing An error log.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: Nik Charleboismailto:[email protected] Sent: Tuesday, December 3, 2019 3:04 PM To: microsoft/Office365DSCmailto:[email protected] Cc: wheelerkmailto:[email protected]; Mentionmailto:[email protected] Subject: Re: [microsoft/Office365DSC] Issues with Export-O365Configuration using MFA (#132)

@wheelerkhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwheelerk&data=02%7C01%7C%7C58ef0ee8e3fd4b22de5e08d7782c00ba%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637110002686459293&sdata=SWcsQ5GQfn%2B8TvxUgQqE%2BPvCf6HxV7aI1lRU52TmWp8%3D&reserved=0 in the actually PowerShell console you used to launched the GUI, do you see any verbose output at all? E.g. Extracting O365AdminAuditLogConfig

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FOffice365DSC%2Fissues%2F132%3Femail_source%3Dnotifications%26email_token%3DAELADMOC6HSCQQWFNOHP7QTQW23UXA5CNFSM4H56KMCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF2UNRA%23issuecomment-561333956&data=02%7C01%7C%7C58ef0ee8e3fd4b22de5e08d7782c00ba%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637110002686459293&sdata=Ci70740zEa%2BaCxSCYKey4T7H9AWazoYeca2TmP%2BlGlY%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAELADMPSXJQ3KKK5YUDHTTDQW23UXANCNFSM4H56KMCA&data=02%7C01%7C%7C58ef0ee8e3fd4b22de5e08d7782c00ba%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637110002686469298&sdata=7Cgt7%2BeiA0PE2bAcOcAR1NBnrCtOlWSxc8fsMTKRMIA%3D&reserved=0.

wheelerk avatar Dec 03 '19 20:12 wheelerk

@wheelerk can you paste in the redacted error log's content?

NikCharlebois avatar Dec 03 '19 20:12 NikCharlebois

[2019/12/03 03:31:53] {AuthenticationError} Microsoft.Open.Azure.AD.CommonLibrary.AadAuthenticationFailedException: One or more errors occurred.: unknown_user_type: Unknown User Type ---> System.AggregateException: One or more errors occurred. ---> Microsoft.IdentityModel.Clients.ActiveDirectory.AdalException: unknown_user_type: Unknown User Type at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenNonInteractiveHandler.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase.d__57.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContextIntegratedAuthExtensions.d__0.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at Microsoft.Open.Azure.AD.CommonLibrary.UserTokenProvider.DoAcquireToken(AdalConfiguration config, PromptBehavior promptBehavior, String userId, SecureString password) in E:\bt\934800\repo\src\dev\PowerShell.V2\CommonLibrary\TokenProvider\UserTokenProvider.cs:line 228 at Microsoft.Open.Azure.AD.CommonLibrary.UserTokenProvider.SafeAquireToken(AdalConfiguration config, ShowDialog showDialog, String userId, SecureString password, Exception& ex) in E:\bt\934800\repo\src\dev\PowerShell.V2\CommonLibrary\TokenProvider\UserTokenProvider.cs:line 152 --- End of inner exception stack trace --- at Microsoft.Open.Azure.AD.CommonLibrary.UserTokenProvider.AcquireToken(AdalConfiguration config, ShowDialog promptBehavior, String userId, SecureString password) in E:\bt\934800\repo\src\dev\PowerShell.V2\CommonLibrary\TokenProvider\UserTokenProvider.cs:line 134 at Microsoft.Open.Azure.AD.CommonLibrary.UserTokenProvider.GetAccessToken(AdalConfiguration config, ShowDialog promptBehavior, String userId, SecureString password, AccountType credentialType) in E:\bt\934800\repo\src\dev\PowerShell.V2\CommonLibrary\TokenProvider\UserTokenProvider.cs:line 57 at Microsoft.Open.Azure.AD.CommonLibrary.AuthenticationFactory.Authenticate(AzureAccount account, AzureEnvironment environment, String tenantId, SecureString password, ShowDialog promptBehavior, TokenCache tokenCache, Endpoint resourceId) in E:\bt\934800\repo\src\dev\PowerShell.V2\CommonLibrary\AuthenticationFactory.cs:line 59 at Microsoft.Open.Azure.AD.CommonLibrary.RMProfileClient.AcquireAccessToken(AzureAccount account, AzureEnvironment environment, String tenantId, SecureString password, ShowDialog promptBehavior) in E:\bt\934800\repo\src\dev\PowerShell.V2\CommonLibrary\RMProfileClient.cs:line 127 at Microsoft.Open.Azure.AD.CommonLibrary.RMProfileClient.Login(AzureAccount account, AzureEnvironment environment, String tenantId, SecureString password) in E:\bt\934800\repo\src\dev\PowerShell.V2\CommonLibrary\RMProfileClient.cs:line 55 at Microsoft.Open.Azure.AD.CommonLibrary.ConnectAzureAD.ProcessRecord() in E:\bt\934800\repo\src\dev\PowerShell.V2\CommonLibrary\ConnectAzureAD.cs:line 163

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Nik Charlebois [email protected] Sent: Tuesday, December 3, 2019 3:52:35 PM To: microsoft/Office365DSC [email protected] Cc: wheelerk [email protected]; Mention [email protected] Subject: Re: [microsoft/Office365DSC] Issues with Export-O365Configuration using MFA (#132)

@wheelerkhttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwheelerk&data=02%7C01%7C%7C46318367531f48a9a87d08d77832ba05%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637110031565840099&sdata=TJHQS4DGgkDjl%2BWZ8%2BAh9vbE4Vb0VF2d7ITAV%2ForylU%3D&reserved=0 can you paste in the redacted error log's content?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FOffice365DSC%2Fissues%2F132%3Femail_source%3Dnotifications%26email_token%3DAELADMKYQGEZQKSCKRY6YRLQW3BJHA5CNFSM4H56KMCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF2YZBA%23issuecomment-561351812&data=02%7C01%7C%7C46318367531f48a9a87d08d77832ba05%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637110031565840099&sdata=%2FWQQNS5c4WZnYjwI5LZyizLB%2BkF9KIurgGEXX5GaP%2B8%3D&reserved=0, or unsubscribehttps://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAELADMLPP3AWWIBG2J35GS3QW3BJHANCNFSM4H56KMCA&data=02%7C01%7C%7C46318367531f48a9a87d08d77832ba05%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637110031565850116&sdata=E%2B6tBKdV3pVh8L8IAnGX%2BoIDvv5CxuzQyozhdNNzuL8%3D&reserved=0.

wheelerk avatar Dec 03 '19 20:12 wheelerk

@wheelerk find me on twitter, and let me know your email address. I'd like to follow-up offline to get additional info about the account sued to connect. Will take it back to this thread for Knowledge Base once root cause has been identified. My handle is @NikCharlebois

NikCharlebois avatar Dec 04 '19 04:12 NikCharlebois

Any chance we can get this working with accounts that use MFA?

wheelerk avatar Jan 16 '20 13:01 wheelerk