A quick an easy post with details on how to connect your Office 365 (O365) environment to allow management with powershell cmdlets
Make sure you change the value next to -Credential from username@domain.com to the username you need to use to connect
$ex = New-PSSession -ConfigurationName Microsoft.Exchange -Credential username@domain.com -ConnectionUri https://outlook.office365.com/powershell -Authentication basic -AllowRedirection
import-pssession $ex
After executing this command, a popup window will appear for you to enter your password into
WARNING: Your connection has been redirected to the following URI: "https://outlook.office365.com/PowerShell-LiveID?PSVersion=5.1.17763.1852 "
WARNING: The names of some imported commands from the module 'tmp_4kculvlx.2wc' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a
list of approved verbs, type Get-Verb.
You can then proceed to manage your Office 365 environment with the standard powershell commands - get-mailbox etc.
No comments:
Post a Comment