Today again I found myself trying to remember the logon commands for Office 365 Powershell! (Weirdly, I can remember commands once I am in, but constantly forget the logon ones). Anyway, because this frustrated me again, a bit of Googling found me this blogpost from Ryan Mangan.
Now, the whole story is not on Ryan’s site. There are some other things you need to do to make his scripts work without constant prompt to run….
- Make sure you run the command Set-ExecutionPolicy Unrestricted
- Make sure to run the command Unblock-File C:\windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
- …and this one…. Unblock-File C:\Office365\office365login.ps1
Thanks Ryan!