Forum Discussion
Can I Connect to O365 Security & Compliance center via powershell with MFA on?
- May 10, 2017
Nope, not yet. It's the last of the "modules" I use to get MFA support :(
The answer is Yes, the new module released for Exchange Online also includes a connection string for accessing the Security and Compliance Center.
https://technet.microsoft.com/en-us/library/mt775114%28v=exchg.160%29.aspx?f=255&MSPPError=-2147217396
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.
- Sankarasubramanian ParameswaranOct 30, 2017Iron Contributor
i'm able to connect to exchange online by below method not security compliance center.
- Paul CunninghamOct 31, 2017Iron Contributor
That method does not seem to work for connecting to the SCC.
- VasilMichevOct 31, 2017MVP
Which method Paul?
- VasilMichevOct 13, 2017MVP
This example is from the thread above, as I said :) And you DO need the module, so it's not just "regular" PowerShell.