Share via

Powershell version 7 does it ever connect into Sharepoint online, exchange online and other of the 365 online groups?

Heather Peake 116 Reputation points
2026-06-02T11:32:47.6833333+00:00

Powershell version 7.6 and previous versions of Powershell 7.

Why does it not connect to the cloud like all the instructions to do stuff with Powershell say it will and then when it won't why am I getting uninstall it and go back to version 3. Is that actually practical?

As a newbie to Powershell 7 it seems like a monster from hell.

Where am I looking for guidelines on how to consistently connect to various cloud parts where I need to be using an admin account in the cloud that I clearly won't have logged my local device on with.

As Micrsoft seems to be removing more and more of the gui control for admin aspects to 365 this is just going to get worse and worse I need a crash course in PowerShell 7 and I can't find one. Can anyone suggest one please?

Microsoft 365 and Office | Subscription, account, billing | For business | Other
0 comments No comments

Answer accepted by question author

AI answer

2026-06-02T11:33:27.3133333+00:00

PowerShell 7 can connect to Microsoft 365 services (Exchange Online, SharePoint Online, Microsoft Graph/Entra ID, Teams), but there are some version and module requirements that differ from older Windows PowerShell 5.1 guidance.

Key points for PowerShell 7 and Microsoft 365

  1. Use the current, supported modules
    • Exchange Online: ExchangeOnlineManagement module (EXO V2+).
    • Microsoft 365/Entra ID/Graph: Microsoft Graph PowerShell SDK.
    • SharePoint Online: SharePoint Online Management Shell.
    • Teams: Teams PowerShell module.
    A consolidated Microsoft 365 PowerShell setup is described in the “Connect to all Microsoft 365 services in a single PowerShell window” and “Manage Microsoft 365 with PowerShell” guidance.
  2. PowerShell 7 version requirements for Exchange Online The Exchange Online module has strict version dependencies in PowerShell 7:
    • Support for PowerShell 7 started with ExchangeOnlineManagement 2.0.4.
    • Module versions 3.0.0–3.4.0 require PowerShell 7.2.x (.NET 6.0).
    • Module versions 3.5.0 or later require PowerShell 7.4.0 or later because of .NET 8.0 dependencies.
    If PowerShell 7.6 (or any 7.x) is below the required runtime for the module version installed, connections can fail or behave inconsistently. That is why some guidance suggests either:
    • Downgrading the module (for example, to 3.5.0) to match an older PowerShell 7 runtime, or
    • Upgrading the runtime (for example, to 7.4) and using a newer module.
    In Azure Automation, for example, a working solution was to create a new runtime environment based on PowerShell 7.4 and then import the needed modules so Exchange Online and Microsoft Graph could both connect in the same runbook.
  3. PowerShell 7 vs Windows PowerShell 5.1
    • All versions of the ExchangeOnlineManagement module are supported in Windows PowerShell 5.1, and the .NET Framework requirements are already met in current Windows versions.
    • Because of this, many older instructions assume Windows PowerShell 5.1 and will “just work” there, while PowerShell 7 requires matching the module version to the PowerShell 7 version.
    • This is why some admins recommend “go back to 5.1” or “use the older module” if PowerShell 7 is misaligned with the module version.
  4. Connecting to Exchange Online in PowerShell 7 After installing a compatible ExchangeOnlineManagement module for the PowerShell 7 version in use:
    • Interactive sign-in (with or without MFA):
           Connect-ExchangeOnline -UserPrincipalName ******@contoso.com
      
      In PowerShell 7, the sign-in prompt opens in the default web browser by default (browser-based SSO).
    • PowerShell 7–exclusive options include:
      • Inline credentials for non-MFA accounts:
               Connect-ExchangeOnline -UserPrincipalName ******@contoso.com -InlineCredential
        
      • Device login for machines without a browser:
               Connect-ExchangeOnline -Device
        
        Then complete authentication via https://microsoft.com/devicelogin with the provided code.
  5. Prerequisites and execution policy For Microsoft 365 PowerShell generally:
    • Use a Microsoft 365 admin account (member of an appropriate admin role) when connecting.
    • On Windows, configure PowerShell to run signed scripts for Exchange Online and other services:
           Set-ExecutionPolicy RemoteSigned
      
    • Ensure the OS and .NET versions meet the module’s requirements. For example, PowerShell 7.2.22 (.NET 6.0) is the latest supported PowerShell 7 on some older Windows versions.
  6. Connecting to multiple Microsoft 365 services from one session Microsoft provides guidance for using a single PowerShell instance to connect to:
    • Microsoft 365 accounts (Graph/Entra ID)
    • Exchange Online
    • SharePoint Online
    • Microsoft Teams
    • Defender for Office 365 and Microsoft Purview compliance
    This requires installing the relevant modules and then running the appropriate connect cmdlets in sequence in the same PowerShell window.
  7. Learning resources (“crash course”) For a structured introduction to Microsoft 365 administration with PowerShell:
    • “Get started with Microsoft 365 PowerShell” explains installing modules and connecting to a subscription.
    • “Manage Microsoft 365 with PowerShell” links to focused topics for Exchange Online, SharePoint, user accounts and licenses, and Security & Compliance.

In practice, the most reliable approach is:

  1. Decide whether to use Windows PowerShell 5.1 or PowerShell 7 for administration.
  2. Match the ExchangeOnlineManagement module version to the chosen PowerShell version (for PowerShell 7, respect the 7.2/7.4 requirements).
  3. Install the Microsoft 365 modules listed in the “Connect to all Microsoft 365 services in a single PowerShell window” guidance.
  4. Use the documented Connect-* cmdlets (Connect-ExchangeOnline, Microsoft Graph SDK connect, SharePoint Online connect, Teams connect) from a single session.

References:

AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Heather Peake 116 Reputation points
    2026-06-02T12:31:41.1366667+00:00

    Device log in with code thing did the trick - I cna finally connect.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.