I have the following PowerShell script and try it to run from my php website to get the email address from M365:
Try { $username = "username" $pass