Useful Scripts

To create a script that would auto-login you to Office 365 or SSO or Windows Azure Active Directory, Copy the following Script in notepad and save it as auto-login.ps1

Once the file is saved with the ps1 extension you can run Powershell as administrator, Drag and drop this file into Powershell and it’ll login you automatically.

TEXT BOX

$powerUser = “admin@domain.onmicrosoft.com”

$powerPass = “password”

$password = ConvertTo-SecureString $powerPass -AsPlainText -Force

$LiveCred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $powerUser,$password

$s=new-pssession -configurationname microsoft.exchange -connectionuri https://ps.outlook.com/powershell -credential $livecred -authentication basic -allowredirection

$import = import-pssession $s

Import-Module MSOnline

connect-msolservice -credential $livecred

Exporting Mailflow transport rules from Office 365 (Exchange Online)

Exporting Rules

Importing rules

Leave a Reply

Your email address will not be published. Required fields are marked *