Monthly Archives: June 2017

Import Module – Launch Exchange Online Powershell with MFA from Powershell

In order to script the connection to exchange online with mfa, you must first download the Microsoft.Exchange.Management.ExoPowershellModule.dll

I assume you will have to periodically update the dll via the EAC GUI.

Open the Exchange admin center (EAC) for your Exchange Online organization.

In the EAC, go to Hybrid > Setup and click the appropriate Configure button to download the Exchange Online Remote PowerShell Module for multi-factor authentication.

Download the Exchange Online PowerShell Module from the Hybrid tab in the EAC

In the Application Install window that opens, click Install.

Click Install in the Exchange Online PowerShell Module window

After you get this working you can proceed.

Now to connect from Powershell:

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

More Details found here.

 

Block domain name postfix

Update postfix config:

vi /etc/postfix/main.cf

smtpd_sender_restrictions = hash:/etc/postfix/access
reject_unauth_destination = hash:/etc/postfix/access

Create block file:

vi /etc/postfix/access

mediatransport.com REJECT

Execute:

postmap hash:/etc/postfix/access
service postfix restart