SOLVED

Can I Connect to O365 Security & Compliance center via powershell with MFA on?

%3CLINGO-SUB%20id%3D%22lingo-sub-68898%22%20slang%3D%22en-US%22%3ECan%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-68898%22%20slang%3D%22en-US%22%3E%3CP%3EI%20currently%20use%20the%20below%20script%20to%20connect%20to%20the%20S%26amp%3BC%20Center.%20This%20does%20not%20work%20with%20MFA.%3C%2FP%3E%3CP%3EI%20was%20wondering%20if%20there%20is%20an%20Updated%20Module%20that%20I%20could%20use%20that%20supports%20modern%20authentication%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24Credential%20%3D%20get-credential%20-Credential%20username.com%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24Session%20%3D%20New-PSSession%20-ConfigurationName%20Microsoft.Exchange%20-ConnectionUri%20%3CA%20href%3D%22https%3A%2F%2Fps.compliance.protection.outlook.com%2Fpowershell-liveid%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fps.compliance.protection.outlook.com%2Fpowershell-liveid%3C%2FA%3E%20-Credential%20%24Credential%20-Authentication%20Basic%20-AllowRedirection%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EImport-PSSession%20%24Session%20-AllowClobber%20%E2%80%93DisableNameChecking%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-68898%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESecurity%20%26amp%3B%20Compliance%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-238610%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-238610%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20you%20were%20able%20to%20sort%20this%20issue%26nbsp%3Bof%20connecting%20to%20the%20Security%20%26amp%3B%20Compliance%26nbsp%3BCenter(for%20MFA%20enabled%20accounts).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Egetting%20this%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENew-ExoPSSession%20%3A%20Connecting%20to%20remote%20server%20can01b.ps.compliance.protection.outlook.com%20failed%20with%20the%20following%3C%2FP%3E%3CP%3Eerror%20message%20%3A%20Access%20is%20denied.%20For%20more%20information%2C%20see%20the%20about_Remote_Troubleshooting%20Help%20topic.%3C%2FP%3E%3CP%3EAt%20C%3A%5CUsers%5Cjgallant%5CAppData%5CLocal%5CApps%5C2.0%5CDLWH4LJ5.9K8%5CD57G1TWM.ECZ%5Cmicr..tion_a8eee8aa09b0c4a7_0010.0000_a11671f1a68%3C%2FP%3E%3CP%3Ebb628%5CCreateExoPSSession.ps1%3A218%20char%3A22%3C%2FP%3E%3CP%3E%2B%20...%20PSSession%20%3D%20New-ExoPSSession%20-UserPrincipalName%20%24UserPrincipalName%20-C%20...%3C%2FP%3E%3CP%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3C%2FP%3E%3CP%3E%2B%20CategoryInfo%20%3A%20ResourceUnavailable%3A%20(%3A)%20%5BNew-ExoPSSession%5D%2C%20PSRemotingTransportException%3C%2FP%3E%3CP%3E%2B%20FullyQualifiedErrorId%20%3A%20System.Management.Automation.Remoting.PSRemotingDataStructureException%2CMicrosoft.Exchang%3C%2FP%3E%3CP%3Ee.Management.ExoPowershellSnapin.NewExoPSSession%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-188555%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-188555%22%20slang%3D%22en-US%22%3E%3CP%3EIt's%20perfectly%20possible%2C%20you%20simply%20need%20to%20edit%20the%20line%20I%20mentioned%20above.%20The%20method%20that%20is%20used%20in%20the%20Gallery%20script%20is%20not%20a%20supported%20one%2C%20and%20you%20will%20use%20%22reconnectability%22%20with%20it%20(you%20cannot%20reconnect%20to%20disconnected%20sessions).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-188440%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-188440%22%20slang%3D%22en-US%22%3E%3CP%3EI%20opened%20a%20ticket%20with%20Premier%20Support%20and%20I%20got%20it%20resolved.%26nbsp%3B%20I%20discovered%20what%20was%20in%20conflict%20was%20that%20the%20%22Connect-EXOPSSession%22%20session%20was%20conflicting%20with%20the%20%22Connect-IPPSSession%22%20session%3B%20not%20the%20Exchange%20On-Premises%20session.%26nbsp%3B%20So%20it%20is%20not%20possible%20use%20the%20Exchange%20Online%20PS%20commands%20and%20the%20Security%20%26amp%3B%20Compliance%20PS%20commands%20at%20the%20same%20time.%26nbsp%3B%20But%20the%20Engineer%20pointed%20me%20to%20a%20O365%20PS%20script%20that%20offers%20the%20code%20to%20connect%20to%20them.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2FOffice-365-Connection-47e03052%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgallery.technet.microsoft.com%2FOffice-365-Connection-47e03052%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20my%20function%20to%20connect%20to%20Exchange%20Online%20is%3A%3C%2FP%3E%3CP%3Efunction%20Connect-EXO%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%24ExoConnectionUri%20%3D%20%22%3CA%20href%3D%22https%3A%2F%2Fps.outlook.com%2Fpowershell%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fps.outlook.com%2Fpowershell%3C%2FA%3E%22%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Import-Module%20%24((Get-ChildItem%20-Path%20%24(%24env%3ALOCALAPPDATA%20%2B%20%22%5CApps%5C2.0%5C%22)%20-Filter%20Microsoft.Exchange.Management.ExoPowershellModule.dll%20-Recurse).FullName%20%7C%20%3F%7B%20%24_%20-notmatch%20%22_none_%22%20%7D%20%7C%20select%20-First%201)%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%24EXOSession%20%3D%20New-ExoPSSession%20-Credential%20%24EXOcreds%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%24ExoImportresults%20%3D%20Import-PSSession%20%24ExoSession%20-AllowClobber%20-Prefix%20EXO%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20then%20connect%20to%20SC%3A%3C%2FP%3E%3CP%3Efunction%20Connect-Compliance%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%24CompConnectionUri%20%3D%20%22%3CA%20href%3D%22https%3A%2F%2Fps.compliance.protection.outlook.com%2Fpowershell-liveid%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fps.compliance.protection.outlook.com%2Fpowershell-liveid%2F%3C%2FA%3E%22%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Import-Module%20%24((Get-ChildItem%20-Path%20%24(%24env%3ALOCALAPPDATA%20%2B%20%22%5CApps%5C2.0%5C%22)%20-Filter%20Microsoft.Exchange.Management.ExoPowershellModule.dll%20-Recurse).FullName%20%7C%20%3F%7B%20%24_%20-notmatch%20%22_none_%22%20%7D%20%7C%20select%20-First%201)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%24Comp%20%3D%20New-EXOPSSession%20-ConnectionUri%20%24CompConnectionUri%20-Credential%20%24EXOcreds%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%24CompImportresults%20%3D%20Import-PSSession%20%24Comp%20-AllowClobber%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20will%20need%20to%20install%20the%20latest%20version%20of%20the%20Exchange%20Online%20Power%20Module%20for%20MFA%20though.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-188119%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-188119%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20problem%20is%20with%20the%20crappy%20logic%20used%20within%20the%20MFA-enabled%20ExO%20PowerShell%20module%20-%20there%20is%20a%20line%20there%20that%20will%20*remove*%20any%20other%20PSSessions.%20You%20need%20to%20edit%20the%20underlying%20script%26nbsp%3Bfile%20manually.%20Line%20175%20if%20you%20are%20using%20the%20latest%20version.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-187900%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-187900%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20having%20a%20problem%20where%20I%20am%20connecting%20to%20Exchange%20Online%2C%20Compliance%20Center%2C%20Exchange%20On-Premises%2C%20and%20Active%20Directory%20PowerShell%20modules%20to%20run%20commands%20from%20each.%20But%20the%20Exchange%20On-Premises%20commands%20are%20clobbering%20the%20Exchange%20Online%20commands%20even%20though%20I%20add%20a%20prefix%20for%20Exchange%20On-Premises.%26nbsp%3B%20To%20connect%20to%20Online%20modules%20with%20the%20following%20commands%3A%3C%2FP%3E%3CP%3EConnect-EXOPSSession%20-UserPrincipalName%20%3CUPN%3E%3CBR%20%2F%3EConnect-IPPSSession%20-UserPrincipalName%20%3CSPAN%3E%26lt%3B%3C%2FSPAN%3E%3CSPAN%3EUPN%26gt%3B%3C%2FSPAN%3E%3C%2FUPN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EFor%20Exchange%20On-Premises%20I%20use%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%24s%20%3D%20New-PSSession%20-ConfigurationName%20Microsoft.Exchange%20-ConnectionUri%20%24ConnUri%20-Authentication%20Kerberos%3CBR%20%2F%3E%24importresults%20%3D%20Import-PSSession%20%24s%20-AllowClobber%20%3CSTRONG%3E-Prefix%20EXOP%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can%20then%20use%20the%20Get-EXOPRecipient%20command%20(for%20Exchange%20On-Premises)%20but%20then%20I%20lose%20the%20Get-Mailbox%20(for%20Exchange%20Online).%26nbsp%3B%20If%20I%20reconnect%20the%20Exchange%20Online%20and%20Compliance%20sessions%2C%20I%20get%20the%20reverse%20where%20I%20can%20run%20Get-Mailbox%20but%20lose%20Get-EXOPRecipient.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20know%20how%20to%20resolve%20this%20issue%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-124876%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-124876%22%20slang%3D%22en-US%22%3E%3CP%3EWorks%20fine%20here%20folks.%20If%20you%20are%20still%20having%20issues%2C%20make%20sure%20to%20open%20a%20support%20case.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-124841%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-124841%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F93005%22%20target%3D%22_blank%22%3E%40Andrew%20Hammond%3C%2FA%3E%26nbsp%3B%20No%2C%20I%20am%20still%20struggling%2C%20I%20have%20raised%20the%20issue%20with%20MS%2C%20will%20keep%20you%20posted%20if%20I%20find%20any%20solution.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-124840%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-124840%22%20slang%3D%22en-US%22%3EI'm%20also%20running%20into%20the%20same%20issue%20was%20fine%20few%20days%20ago%20now%20the%20same%20error.%20did%20you%20manage%20to%20fix%20this%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-124824%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-124824%22%20slang%3D%22en-US%22%3E%3CP%3EEven%20I%20am%20getting%20this%20error%2C%20it%20worked%20fine%20last%20week%20and%20now%20it%20doesn't%2C%20almost%20like%202%20days.%3C%2FP%3E%3CP%3EConnecting%20to%20remote%20server%20aus01b.ps.compliance.protection.outlook.com%20failed%20with%20the%20following%20error%20message%20%3A%20%3CA%20href%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-strict.dtd%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-strict.dtd%3C%2FA%3E%22%26gt%3B%3CBR%20%2F%3E%3CA%20href%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%3C%2FA%3E%22%26gt%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26lt%3Bmeta%20http-equiv%3D%22%22Content-Type%22%22%20content%3D%22%22text%2Fhtml%3B%22%20charset%3D%22iso-8859-1%22%2F%22%20%2F%26gt%3B%3CBR%20%2F%3E%3CTITLE%3E500%20-%20Internal%20server%20error.%3C%2FTITLE%3E%3CBR%20%2F%3E%3CSTYLE%20type%3D%22%26quot%3Btext%2Fcss%26quot%3B%22%3E%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3B!--%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bbody%7Bmargin%3A0%3Bfont-size%3A.7em%3Bfont-family%3AVerdana%2C%20Arial%2C%20Helvetica%2C%20sans-serif%3Bbackground%3A%23EEEEEE%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bfieldset%7Bpadding%3A0%2015px%2010px%2015px%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bh1%7Bfont-size%3A2.4em%3Bmargin%3A0%3Bcolor%3A%23FFF%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bh2%7Bfont-size%3A1.7em%3Bmargin%3A0%3Bcolor%3A%23CC0000%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bh3%7Bfont-size%3A1.2em%3Bmargin%3A10px%200%200%200%3Bcolor%3A%23000000%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%23header%7Bwidth%3A96%25%3Bmargin%3A0%200%200%200%3Bpadding%3A6px%202%25%206px%202%25%3Bfont-family%3A%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Btrebuchet%20MS%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20Verdana%2C%20sans-serif%3Bcolor%3A%23FFF%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bbackground-color%3A%23555555%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%23content%7Bmargin%3A0%200%200%202%25%3Bposition%3Arelative%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B.content-container%7Bbackground%3A%23FFF%3Bwidth%3A96%25%3Bmargin-top%3A8px%3Bpadding%3A10px%3Bposition%3Arelative%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B--%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%3C%2FSTYLE%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CDIV%20id%3D%22%26quot%3Bheader%26quot%3B%22%3E%3CH1%20id%3D%22toc-hId-1900476094%22%20id%3D%22toc-hId-1900476094%22%20id%3D%22toc-hId-1900476094%22%3EServer%20Error%3C%2FH1%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%20id%3D%22%26quot%3Bcontent%26quot%3B%22%3E%3CBR%20%2F%3E%3CDIV%20class%3D%22%26quot%3Bcontent-container%26quot%3B%22%3E%3CFIELDSET%3E%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId--848194372%22%20id%3D%22toc-hId--848194372%22%20id%3D%22toc-hId--848194372%22%3E500%20-%20Internal%20server%20error.%3C%2FH2%3E%3CBR%20%2F%3E%3CH3%20id%3D%22toc-hId-698102458%22%20id%3D%22toc-hId-698102458%22%20id%3D%22toc-hId-698102458%22%3EThere%20is%20a%20problem%20with%20the%20resource%20you%20are%20looking%20for%2C%20and%20it%20cannot%20be%20displayed.%3C%2FH3%3E%3CBR%20%2F%3E%3C%2FFIELDSET%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20idea%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-123763%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-123763%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3A%20Thanks%20for%20the%20explanation%2C%20I%20wasn't%20aware%20of%20this%20fact%20that%20it%20closes%20the%20earlier%20connected%20session.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-122995%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-122995%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F91662%22%20target%3D%22_blank%22%3E%40Rahul%20Srivastav%3C%2FA%3E%26nbsp%3Bthat%20depends%20on%20the%20method%20you%20used%20to%20connect.%20If%20it's%20be%20built-in%20method%20from%20the%20module%2C%20it%20will%20clear%20*any*%20existing%20sessions%20upon%20connect%2C%20including%20ExO%2FSCC%20ones%2C%20so%20there%20is%20no%20need%20to%20check.%20If%20you%20use%20a%20custom%20method%2C%20simply%20check%20via%20Get-PSSession%2C%20the%20SCC%20one%20has%20%22compliance%22%20in%20the%20connectionURI.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-122925%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-122925%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20module%20gets%20better%20and%20better.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-122879%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-122879%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20folk%20for%20this%20thread%2C%20I%20was%20able%20to%20connect%20with%20Connect-IPPSession%20for%20MFA%20enabled%20account.%20I%20want%20to%20know%20is%20there%20a%20way%20I%20can%20check%20if%20a%20session%20to%20compliance%20center%20already%20exist.%20This%20way%20I%20can%20avoid%20authentication%20multiple%20times.%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-122807%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-122807%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20simply%20need%20to%20provide%20the%20SCC%20endpoint%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%24session%20%3D%20New-ExoPSSession%20-ConnectionUri%20https%3A%2F%2Fps.compliance.protection.outlook.com%2FPowerShell-LiveId%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-122576%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-122576%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20one%20Tony%20posted%20but%20using%20the%20SCC%20cmdlet%20instead%20of%20the%20EXO%20cmdlet.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-122482%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-122482%22%20slang%3D%22en-US%22%3E%3CP%3EWhich%20method%20Paul%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-122455%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-122455%22%20slang%3D%22en-US%22%3E%3CP%3EThat%20method%20does%20not%20seem%20to%20work%20for%20connecting%20to%20the%20SCC.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-122167%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-122167%22%20slang%3D%22en-US%22%3E%3CP%3Ei'm%20able%20to%20connect%20to%20exchange%20online%20by%20below%20method%20not%20security%20compliance%20center.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-119990%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-119990%22%20slang%3D%22en-US%22%3E%3CP%3EWell%20it%20took%20some%20time%2C%20but%20it%20seems%20to%20be%20working%20fine%20now.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-119719%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-119719%22%20slang%3D%22en-US%22%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-119449%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-119449%22%20slang%3D%22en-US%22%3E%3CP%3EYup%2C%20I%20get%20the%20same%20today.%20Let%20me%20ping%20some%20folks...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-119381%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-119381%22%20slang%3D%22en-US%22%3E%3CP%3EMFA%20seems%20to%20be%20working%20for%20other%20items%2C%20but%20when%20I%20try%20Security%20and%20Compliance%2C%20I'm%20getting%20a%20500%20error%20back%20from%20the%20server.%20See%20below.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS%20C%3A%5CUsers%5CJeff%26gt%3B%20Connect-IPPSSession%3CBR%20%2F%3EWARNING%3A%20Your%20connection%20has%20been%20redirected%20to%20the%20following%20URI%3A%3CBR%20%2F%3E%22%3CA%20href%3D%22https%3A%2F%2Fnam02b.ps.compliance.protection.outlook.com%2FPowerShell-LiveId%3FBasicAuthToOAuthConversion%3Dtrue%3BPSVersion%3D5.1.14409.1005%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fnam02b.ps.compliance.protection.outlook.com%2FPowerShell-LiveId%3FBasicAuthToOAuthConversion%3Dtrue%3BPSVersion%3D5.1.14409.1005%3C%2FA%3E%20%22%3CBR%20%2F%3ENew-ExoPSSession%20%3A%20Connecting%20to%20remote%20server%20nam02b.ps.compliance.protection.outlook.com%20failed%20with%20the%20following%20error%20message%20%3A%20%3CBR%20%2F%3E%22-%2F%2FW3C%2F%2FDTD%20XHTML%201.0%20Strict%2F%2FEN%22%20%22%3CA%20href%3D%22http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-strict.dtd%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-strict.dtd%3C%2FA%3E%22%26gt%3B%3CBR%20%2F%3E%3CA%20href%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%3C%2FA%3E%22%26gt%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%26lt%3Bmeta%20http-equiv%3D%22%22Content-Type%22%22%20content%3D%22%22text%2Fhtml%3B%22%20charset%3D%22iso-8859-1%22%2F%22%20%2F%26gt%3B%3CBR%20%2F%3E%3CTITLE%3E500%20-%20Internal%20server%20error.%3C%2FTITLE%3E%3CBR%20%2F%3E%3CSTYLE%20type%3D%22%26quot%3Btext%2Fcss%26quot%3B%22%3E%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3B!--%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bbody%7Bmargin%3A0%3Bfont-size%3A.7em%3Bfont-family%3AVerdana%2C%20Arial%2C%20Helvetica%2C%20sans-serif%3Bbackground%3A%23EEEEEE%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bfieldset%7Bpadding%3A0%2015px%2010px%2015px%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bh1%7Bfont-size%3A2.4em%3Bmargin%3A0%3Bcolor%3A%23FFF%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bh2%7Bfont-size%3A1.7em%3Bmargin%3A0%3Bcolor%3A%23CC0000%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bh3%7Bfont-size%3A1.2em%3Bmargin%3A10px%200%200%200%3Bcolor%3A%23000000%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%23header%7Bwidth%3A96%25%3Bmargin%3A0%200%200%200%3Bpadding%3A6px%202%25%206px%202%25%3Bfont-family%3A%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3Btrebuchet%20MS%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bquot%3B%2C%20Verdana%2C%20sans-serif%3Bcolor%3A%23FFF%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3Bbackground-color%3A%23555555%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%23content%7Bmargin%3A0%200%200%202%25%3Bposition%3Arelative%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B.content-container%7Bbackground%3A%23FFF%3Bwidth%3A96%25%3Bmargin-top%3A8px%3Bpadding%3A10px%3Bposition%3Arelative%3B%7D%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B--%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Blt%3BBR%20%2F%26amp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bamp%3Bgt%3B%3C%2FSTYLE%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CDIV%20id%3D%22%26quot%3Bheader%26quot%3B%22%3E%3CH1%20id%3D%22toc-hId--1461027493%22%20id%3D%22toc-hId--1461027493%22%20id%3D%22toc-hId--1461027493%22%3EServer%20Error%3C%2FH1%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%20id%3D%22%26quot%3Bcontent%26quot%3B%22%3E%3CBR%20%2F%3E%3CDIV%20class%3D%22%26quot%3Bcontent-container%26quot%3B%22%3E%3CFIELDSET%3E%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-85269337%22%20id%3D%22toc-hId-85269337%22%20id%3D%22toc-hId-85269337%22%3E500%20-%20Internal%20server%20error.%3C%2FH2%3E%3CBR%20%2F%3E%3CH3%20id%3D%22toc-hId-1631566167%22%20id%3D%22toc-hId-1631566167%22%20id%3D%22toc-hId-1631566167%22%3EThere%20is%20a%20problem%20with%20the%20resource%20you%20are%20looking%20for%2C%20and%20it%20cannot%20be%20displayed.%3C%2FH3%3E%3CBR%20%2F%3E%3C%2FFIELDSET%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20more%20information%2C%20see%20the%20about_Remote_Troubleshooting%20Help%20topic.%3CBR%20%2F%3EAt%20C%3A%5CUsers%5CJeff%5CAppData%5CLocal%5CApps%5C2.0%5CER689GCY.C50%5CE15M7H1X.VJ5%5Cmicr..tion_d8f8f667ee342b5c_0010.0000_46e6ccd01daac800%5CCreateExoPSSession.ps1%3A183%20char%3A22%3CBR%20%2F%3E%2B%20...%20PSSession%20%3D%20New-ExoPSSession%20-UserPrincipalName%20%24UserPrincipalName%20-C%20...%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20ResourceUnavailable%3A%20(%3A)%20%5BNew-ExoPSSession%5D%2C%20PSRemotingTransportException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20System.Management.Automation.Remoting.PSRemotingDataStructureException%2CMicrosoft.Exchange.Management.ExoPowershellSnapin.NewExoP%3CBR%20%2F%3ESSession%3CP%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-116231%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116231%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20example%20is%20from%20the%20thread%20above%2C%20as%20I%20said%20%3A)%3C%2Fimg%3E%20And%20you%20DO%20need%20the%20module%2C%20so%20it's%20not%20just%20%22regular%22%20PowerShell.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-116067%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116067%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20answer%20is%20Yes%2C%20the%20new%20module%20released%20for%20Exchange%20Online%20also%20includes%20a%20connection%20string%20for%20accessing%20the%20Security%20and%20Compliance%20Center.%3C%2FP%3E%3CP%3E%26nbsp%3B%3CA%20title%3D%22Connect%20to%20Exchange%20Online%20PowerShell%20using%20multi-factor%20authentication%22%20href%3D%22https%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Fmt775114%2528v%3Dexchg.160%2529.aspx%3Ff%3D255%26amp%3BMSPPError%3D-2147217396%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EConnect%20to%20Exchange%20Online%20PowerShell%20using%20multi-factor%20authentication%3C%2FA%3E%3C%2FP%3E%3CP%3EThis%20will%20install%20a%20ClickOnce%26nbsp%3Bapp%20reference%20to%20launch%20the%20console%20with%20the%20module%20pre-loaded.%3C%2FP%3E%3CP%3EWhen%20you%20launch%20the%20console%20you%20will%20see%20this%20message%3A%3C%2FP%3E%3CPRE%3E--------------------------------------------------------------------------%0A%0AThis%20PowerShell%20module%20allows%20you%20to%20connect%20to%20Exchange%20Online%20service.%0ATo%20connect%2C%20use%3A%20Connect-EXOPSSession%20-UserPrincipalName%20%26lt%3Byour%20UPN%26gt%3B%0AThis%20PowerShell%20module%20allows%20you%20to%20connect%20Exchange%20Online%20Protection%20and%20Security%20%26amp%3B%20Compliance%20Center%20services%20also.%0ATo%20connect%2C%20use%3A%20Connect-IPPSSession%20-UserPrincipalName%20%26lt%3Byour%20UPN%26gt%3B%0A%0ATo%20get%20additional%20information%2C%20use%3A%20Get-Help%20Connect-EXOPSSession%2C%20or%20Get-Help%20Connect-IPPSSession%0A%0A--------------------------------------------------------------------------%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnfortunately%2C%20this%20limits%20the%20module's%20usefulness%20since%20we%20cannot%20run%20this%20in%20the%20ISE%20or%20on%20a%20different%20Powershell%20Console.%3C%2FP%3E%3CP%3E%3CSTRIKE%3EAfter%20some%20intense%20googling%2C%20binging%20I%20found%20a%20script%20that%20allows%20you%20to%20do%20just%20that.%3C%2FSTRIKE%3E%3C%2FP%3E%3CP%3EThanks%20to%20Vasil%20for%20pointing%20out%20that%20the%20code%20below%20is%20already%20in%20an%20earlier%20portion%20of%20the%20thread%2C%26nbsp%3BSorry%20I%20missed%20that.%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CPRE%3EImport-Module%20-Name%20%24((Get-ChildItem%20-Path%20%24(%24env%3ALOCALAPPDATA%20%2B%20'%5CApps%5C2.0%5C')%20-Filter%20Microsoft.Exchange.Management.ExoPowershellModule.dll%20-Recurse).FullName%20%7C%20%3F%7B%20%24_%20-notmatch%20'_none_'%20%7D%20%7C%20Select-Object%20-First%201)%0A%24EXOSession%20%3D%20New-ExoPSSession%0AImport-PSSession%20-Session%20%24EXOSession%20-AllowClobber%20%3C%2FPRE%3E%3CP%3EYou%20must%20first%20install%20the%20module%20as%20indicated%20in%20the%20reference%20above.%3C%2FP%3E%3CP%3ELet%20me%20know%20if%20you%20have%20any%20questions.%3C%2FP%3E%3CP%3ENOTE%3A%20I%20should%20point%20out%20that%20I%20have%20had%20issues%20with%20this%20method%20when%20using%20the%20ISE.%20When%20the%20session%20has%20timed%20out%2C%20the%20ISE%20locks%20up%20when%20it%20comes%20time%20to%20prompt%20for%20credentials%20to%20reauthenticate.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-116038%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-116038%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can't%2C%20that's%20the%20whole%20idea%20behind%20Microsoft%20releasing%20a%20new%20module.%20You%20can%20import%2Fuse%20it%20with%20your%20existing%20scripts%20however%2C%20there%20are%20examples%20in%20the%20thread%20above.%20Or%20you%20can%20get%20the%20token%20programmatically%2C%20but%20that's%20even%20more%20complicated.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-115988%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-115988%22%20slang%3D%22en-US%22%3E%3CP%3Ehow%20we%20can%20connect%20to%20MFA%20using%20regular%20powershell%20instead%20of%20connecting%20with%20module%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-115983%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-115983%22%20slang%3D%22en-US%22%3EHi%2C%20whether%20we%20need%20to%20change%20our%20existing%20scripts%20to%20add%20exopssession%20for%20the%20MFA%20authentication%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-108016%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-108016%22%20slang%3D%22en-US%22%3E%3CP%3EThrough%20some%20trial%20and%20error%2C%20I%20have%20discovered%20that%20the%20below%20script%20allows%20me%20to%20connect%20to%20Security%20%26amp%3B%20Compliance%20Center.%20This%20is%20modified%20fromt%20he%20original%20located%20at%20%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2FSearch-for-and-delete-email-messages-in-your-Office-365-organization-Admin-Help-3526fd06-b45f-445b-aed4-5ebd37b3762a%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2FSearch-for-and-delete-email-messages-in-your-Office-365-organization-Admin-Help-3526fd06-b45f-445b-aed4-5ebd37b3762a%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20also%20got%20the%20idea%20from%20you.%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24UserCredential%20%3D%20Get-Credential%3CBR%20%2F%3E%24Session%20%3D%20New-EXOPSSession%20-ConnectionUri%20'%3CA%20href%3D%22https%3A%2F%2Fps.compliance.protection.outlook.com%2Fpowershell-liveid%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fps.compliance.protection.outlook.com%2Fpowershell-liveid%3C%2FA%3E'%3CBR%20%2F%3EImport-PSSession%20%24Session%20-AllowClobber%20-DisableNameChecking%3CBR%20%2F%3E%24Host.UI.RawUI.WindowTitle%20%3D%20%24UserCredential.UserName%20%2B%20%22%20(Office%20365%20Security%20%26amp%3B%20Compliance%20Center)%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-104313%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-104313%22%20slang%3D%22en-US%22%3E%3CP%3EJust%20FYI%2C%20the%20deployment%20seems%20to%20have%20finallized%20across%20all%20datacenters%2Fregions.%20The%20issues%20I%20had%20with%20connecting%20have%20disappeared%20now%2C%20and%20I%20can%20access%20the%20SCC%20cmdlets%20with%20the%20MFA%20module%20just%20fine%2C%20across%20all%20tenants.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-104175%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-104175%22%20slang%3D%22en-US%22%3E%3CP%3EAwesome.%20%26nbsp%3BThat%20does%20it%2C%20which%20means%20we%20now%20have%20parity%20between%20PS%20with%20and%20without%20MFA!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20to%20connect%20ONLY%20to%20the%20CC%20using%20MFA%2C%20it%20looks%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EImport-Module%20%24((Get-ChildItem%20-Path%20%24(%24env%3ALOCALAPPDATA%2B%22%5CApps%5C2.0%5C%22)%20-Filter%20Microsoft.Exchange.Management.ExoPowershellModule.dll%20-Recurse%20).FullName%7C%3F%7B%24_%20-notmatch%20%22_none_%22%7D%7Cselect%20-First%201)%0A%24MFCCPSSession%20%3D%20New-ExoPSSession%20-ConnectionUri%20'https%3A%2F%2Fps.compliance.protection.outlook.com%2FPowerShell-LiveId'%0Aimport-pssession%20%24MFCCPSSession%3C%2FPRE%3E%3CP%3EAlso%20note%3A%20%26nbsp%3BHere%20is%20a%20MS%20Gallery%20script%20to%20connect%20to%20all%20the%20O365%20components%20with%20MFA.%20%26nbsp%3BIt%20currently%20doesn't%20include%20the%20Compliance%20Center%2C%20but%20I%20suspect%20it%20will%20soon!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20Vasil!%3C%2FP%3E%3CP%3E-Shawn%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgallery.technet.microsoft.com%2FOffice-365-Connection-47e03052%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgallery.technet.microsoft.com%2FOffice-365-Connection-47e03052%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-103642%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-103642%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20uses%20the%20same%20module%20and%20the%20same%20cmdlet%2C%20just%20differnt%20parameters.%20Simply%20open%20the%20CreateExoPSSession.ps1%20from%20the%20install%20dir%2C%20and%20you%20will%20see%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%230000ff%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3ENew-EXOPSSession%3C%2FFONT%3E%20%3CFONT%20color%3D%22%23000080%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E-ConnectionUri%3C%2FFONT%3E%20%3CFONT%20color%3D%22%238b0000%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3E'%3CA%20href%3D%22https%3A%2F%2Fps.compliance.protection.outlook.com%2FPowerShell-LiveId%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fps.compliance.protection.outlook.com%2FPowerShell-LiveId%3C%2FA%3E'%3C%2FFONT%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-103591%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-103591%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20you%20launch%20it%20from%20the%20%22Microsoft%20Exchange%20Online%20Powershell%20Module%22%20it%20works%20great...%3C%2FP%3E%3CP%3EBut%20if%20you%20do%20lots%20of%20PS%20administration%20of%20O365%2C%20it's%20horrible%20to%20have%20to%20launch%20a%20separate%20window%20just%20for%20this.%20%26nbsp%3BI%20need%20to%20be%20able%20to%20have%20it%20import%20the%20commandlets%20from%20these%20modules%20into%20other%20PS%20consoles.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20found%20how%20to%20do%20the%20Exchange%20side%20(link%20below)%2C%20but%20cannot%20figure%20out%20how%20to%20do%20the%20same%20for%20the%20Compliance%20Center.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20the%20short%20version%20for%20Exchange%20MFA...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%20Import-Module%20%24((Get-ChildItem%20-Path%20%24(%24env%3ALOCALAPPDATA%2B%22%5CApps%5C2.0%5C%22)%20-Filter%20Microsoft.Exchange.Management.ExoPowershellModule.dll%20-Recurse%20).FullName%7C%3F%7B%24_%20-notmatch%20%22_none_%22%7D%7Cselect%20-First%201)%0A%20%24EXOSession%20%3D%20New-ExoPSSession%0AImport-PSSession%20%24EXOSession%3C%2FPRE%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FScine%2FPowershell%2Fblob%2Fmaster%2FConnect%2520To%2520Powershell%2520with%2520or%2520without%25202%2520form%2520factor%2520auth%2520enabled%20%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FScine%2FPowershell%2Fblob%2Fmaster%2FConnect%2520To%2520Powershell%2520with%2520or%2520without%25202%2520form%2520factor%2520auth%2520enabled%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20ideas%20on%20how%20to%20do%20the%20same%20for%20Compliance%20Center%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-102519%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-102519%22%20slang%3D%22en-US%22%3E%3CP%3EYeah%2C%20for%20whatever%20reason%20it's%20not%20working%20in%20my%20tenant%2C%20as%20well%20as%20in%20my%20test%20tenants.%20I%20tried%20it%20earlier%20with%20a%20DEMO%20tenant%20and%20it%20works%20as%20expected.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20curious%2C%20do%20you%20happen%20to%20have%20E5%20licenses%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-102277%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-102277%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Vasil%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYup%2C%20its%20working.%20Please%20check%20the%20below%20screenshot.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F19440i040CFA3C9B676F4B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222017-08-31_11-32-27.png%22%20title%3D%222017-08-31_11-32-27.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-102139%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-102139%22%20slang%3D%22en-US%22%3E%3CP%3EDoes%20it%20work%20for%20you%20though%3F%20The%20cmdlet%20has%20been%20available%20for%20at%20least%20a%20month%20now%2C%20but%20every%20time%20I%20try%20to%20connect%20I%20get%20Access%20denied%20errors.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-102065%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-102065%22%20slang%3D%22en-US%22%3E%3CP%3EAwesome%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F39292%22%20target%3D%22_blank%22%3E%40SATYAM%20GUPTA%3C%2FA%3E!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-102047%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-102047%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20download%20the%20latest%20MFA%20enabled%20Powershell%20from%20EAC.%20It%20contains%20the%20cmdlet%20name%20connect-IPPSsession%20which%20will%20connect%20to%20S%26amp%3BC.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20994px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F19390i9233498642FD94D5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222017-08-30_17-48-21.png%22%20title%3D%222017-08-30_17-48-21.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-94798%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-94798%22%20slang%3D%22en-US%22%3E%3CP%3EWell%2C%20the%20latest%20version%20of%20the%20MFA-enabled%20ExO%20PowerShell%20module%20hints%20that%20this%20might%20be%20coming%20soon(ish).%20Fingers%20crossed!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-94688%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-94688%22%20slang%3D%22en-US%22%3E%3CP%3EI%20contacted%20Microsoft%20Support%20today.%20%26nbsp%3BThis%20the%20response%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%22I%20am%20aware%20of%20this%20limitation%20however%20when%20I%20checked%20in%20our%20RoadMap%20site%20I%20don%E2%80%99t%20see%20any%20mentioning%20of%20this%20as%20a%20coming%20soon%20feature.%20I%20also%20checked%20in%20our%20Database%20and%20it%20appears%20that%20unlike%20Exchange%20online%20security%20and%20compliance%20current%20design%20does%20not%20support%20MFA%20connection.%20The%20suggested%20work%20around%20from%20engineering%20is%20to%20create%20one%20compliance%20account%20and%20use%20it%20for%20that%20purpose%20(%20do%20not%20enable%20MFA%20on%20that%20account)%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-68924%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-68924%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20the%20Response%20Vasil.%20Such%20a%20pain%20to%20have%20to%20turn%20of%20MFA%20to%20run%20a%20Purge!%20%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-68922%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-68922%22%20slang%3D%22en-US%22%3E%3CP%3ENope%2C%20not%20yet.%20It's%20the%20last%20of%20the%20%22modules%22%20I%20use%20to%20get%20MFA%20support%20%3A(%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1781032%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20Connect%20to%20O365%20Security%20%26amp%3B%20Compliance%20center%20via%20powershell%20with%20MFA%20on%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1781032%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F76158%22%20target%3D%22_blank%22%3E%40Shawn%20Saucier%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20by%20far%20the%20easiest%20connection%20method%20I've%20found%20to%20date!%20Thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Super Contributor

I currently use the below script to connect to the S&C Center. This does not work with MFA.

I was wondering if there is an Updated Module that I could use that supports modern authentication?

 

$Credential = get-credential -Credential username.com

 

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-liveid -Credential $Credential -Authentication Basic -AllowRedirection

 

Import-PSSession $Session -AllowClobber –DisableNameChecking

 

42 Replies
Highlighted
Best Response confirmed by Robert Woods (Super Contributor)
Solution

Nope, not yet. It's the last of the "modules" I use to get MFA support :(

Highlighted

Thanks for the Response Vasil. Such a pain to have to turn of MFA to run a Purge!  

Highlighted

I contacted Microsoft Support today.  This the response

 

"I am aware of this limitation however when I checked in our RoadMap site I don’t see any mentioning of this as a coming soon feature. I also checked in our Database and it appears that unlike Exchange online security and compliance current design does not support MFA connection. The suggested work around from engineering is to create one compliance account and use it for that purpose ( do not enable MFA on that account)"

Highlighted

Well, the latest version of the MFA-enabled ExO PowerShell module hints that this might be coming soon(ish). Fingers crossed!

Highlighted

Hi,

 

You can download the latest MFA enabled Powershell from EAC. It contains the cmdlet name connect-IPPSsession which will connect to S&C.

 

2017-08-30_17-48-21.png

Highlighted
Highlighted

Does it work for you though? The cmdlet has been available for at least a month now, but every time I try to connect I get Access denied errors.

Highlighted

Hi Vasil,

 

Yup, its working. Please check the below screenshot.

 

2017-08-31_11-32-27.png

Highlighted

Yeah, for whatever reason it's not working in my tenant, as well as in my test tenants. I tried it earlier with a DEMO tenant and it works as expected.

 

Just curious, do you happen to have E5 licenses?

Highlighted

If you launch it from the "Microsoft Exchange Online Powershell Module" it works great...

But if you do lots of PS administration of O365, it's horrible to have to launch a separate window just for this.  I need to be able to have it import the commandlets from these modules into other PS consoles.

 

I found how to do the Exchange side (link below), but cannot figure out how to do the same for the Compliance Center.

 

Here is the short version for Exchange MFA...

 

	Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch "_none_"}|select -First 1)
	$EXOSession = New-ExoPSSession
Import-PSSession $EXOSession

https://github.com/Scine/Powershell/blob/master/Connect%20To%20Powershell%20with%20or%20without%202%...

 

Any ideas on how to do the same for Compliance Center?

Highlighted

It uses the same module and the same cmdlet, just differnt parameters. Simply open the CreateExoPSSession.ps1 from the install dir, and you will see it.

 

New-EXOPSSession -ConnectionUri 'https://ps.compliance.protection.outlook.com/PowerShell-LiveId'

Highlighted

Awesome.  That does it, which means we now have parity between PS with and without MFA!

 

So to connect ONLY to the CC using MFA, it looks like this:

 

Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch "_none_"}|select -First 1)
$MFCCPSSession = New-ExoPSSession -ConnectionUri 'https://ps.compliance.protection.outlook.com/PowerShell-LiveId'
import-pssession $MFCCPSSession

Also note:  Here is a MS Gallery script to connect to all the O365 components with MFA.  It currently doesn't include the Compliance Center, but I suspect it will soon!

 

Thanks Vasil!

-Shawn

https://gallery.technet.microsoft.com/Office-365-Connection-47e03052

Highlighted

Just FYI, the deployment seems to have finallized across all datacenters/regions. The issues I had with connecting have disappeared now, and I can access the SCC cmdlets with the MFA module just fine, across all tenants.

Highlighted

Through some trial and error, I have discovered that the below script allows me to connect to Security & Compliance Center. This is modified fromt he original located at https://support.office.com/en-us/article/Search-for-and-delete-email-messages-in-your-Office-365-org...

I also got the idea from you. :)

 

$UserCredential = Get-Credential
$Session = New-EXOPSSession -ConnectionUri 'https://ps.compliance.protection.outlook.com/powershell-liveid'
Import-PSSession $Session -AllowClobber -DisableNameChecking
$Host.UI.RawUI.WindowTitle = $UserCredential.UserName + " (Office 365 Security & Compliance Center)"

Highlighted
Hi, whether we need to change our existing scripts to add exopssession for the MFA authentication
Highlighted

how we can connect to MFA using regular powershell instead of connecting with module

Highlighted

You can't, that's the whole idea behind Microsoft releasing a new module. You can import/use it with your existing scripts however, there are examples in the thread above. Or you can get the token programmatically, but that's even more complicated.

Highlighted

The answer is Yes, the new module released for Exchange Online also includes a connection string for accessing the Security and Compliance Center.

 Connect to Exchange Online PowerShell using multi-factor authentication

This will install a ClickOnce app reference to launch the console with the module pre-loaded.

When you launch the console you will see this message:

--------------------------------------------------------------------------

This PowerShell module allows you to connect to Exchange Online service.
To connect, use: Connect-EXOPSSession -UserPrincipalName <your UPN>
This PowerShell module allows you to connect Exchange Online Protection and Security & Compliance Center services also.
To connect, use: Connect-IPPSSession -UserPrincipalName <your UPN>

To get additional information, use: Get-Help Connect-EXOPSSession, or Get-Help Connect-IPPSSession

--------------------------------------------------------------------------

 

Unfortunately, this limits the module's usefulness since we cannot run this in the ISE or on a different Powershell Console.

After some intense googling, binging I found a script that allows you to do just that.

Thanks to Vasil for pointing out that the code below is already in an earlier portion of the thread, Sorry I missed that. :)

Import-Module -Name $((Get-ChildItem -Path $($env:LOCALAPPDATA + '\Apps\2.0\') -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse).FullName | ?{ $_ -notmatch '_none_' } | Select-Object -First 1)
$EXOSession = New-ExoPSSession
Import-PSSession -Session $EXOSession -AllowClobber 

You must first install the module as indicated in the reference above.

Let me know if you have any questions.

NOTE: I should point out that I have had issues with this method when using the ISE. When the session has timed out, the ISE locks up when it comes time to prompt for credentials to reauthenticate.

 

Highlighted

This example is from the thread above, as I said :) And you DO need the module, so it's not just "regular" PowerShell.