Here is the PowerShell script to connect to office365 with username and password and run queries. $Office365Username = Read More Powershell script to connect to office365 with username and password