Cadzow Knowledgebase


Welcome
Contact Us
Professional
Services

Consulting
Knowledgebase/
Site Search

Remote Support

Print Friendly

Microsoft 365 — Connecting via PowerShell

To open a PowerShell session with Office 365:

  1. Run PowerShell.

  2. Enter:

    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCred -Authentication Basic -AllowRedirection

  3. Enter the Global Administrator credentials when prompted.

  4. Enter:

    Import-PSSession $Session -DisableNameChecking

  5. Enter the desired commands.

  6. When finished, enter:

    Remove-PSSession $Session

You can enter as many commands as required within a session, and leave a session running for a long time. If PowerShell is closed without removing the session, the session will expire by itself anyway. However, this may prevent further logins if too many sessions are left open.

Copyright © 1996-2020 Cadzow TECH Pty. Ltd. All rights reserved.
Information and prices contained in this website may change without notice. Terms of use.


Question/comment about this page? Please email webguru@cadzow.com.au