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 :(
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.
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-organization-Admin-Help-3526fd06-b45f-445b-aed4-5ebd37b3762a
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)"
- VasilMichevOct 12, 2017MVP
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.
- Sankarasubramanian ParameswaranOct 12, 2017Iron Contributor
how we can connect to MFA using regular powershell instead of connecting with module
- Sankarasubramanian ParameswaranOct 12, 2017Iron ContributorHi, whether we need to change our existing scripts to add exopssession for the MFA authentication