PowerShell Modules / CMDLETs – Connecting to Microsoft 365 Services

Hi All,
Greetings for the day!!!
In this article I am discussing how to connect with different PowerShell modules which work with Microsoft 365 environment
PnP PowerShell
- For using PnP PowerShell, we need to install module PnP.PowerShell
Install-Module PnP.PowerShell

- Once PnP.PowerShell module is installed we are ready to execute PnP.PowerShell CMDLETS
- Lets connect SharePoint online site using Connect-PnPOnline
PS C:\> $ClientID = "768437d9-957a-4a5e-b91a-f68213bf6d33"
PS C:\> $SiteURL = "https://knowledgejunction1.sharepoint.com/"
PS C:\> Connect-PnPOnline -Url $SiteURL -Interactive -ClientId $clientId
PS C:\> Get-PnPSite
Url CompatibilityLevel
--- ------------------
https://knowledgejunction1.sharepoint.com 15
PS C:\>

- We have detailed article to start with PnP PowerShell module. PowerShell : Getting Started with PnP PowerShell Cmdlets – https://knowledge-junction.in/2025/06/04/powershell-pnp-powershell/
Exchange Online
- We have “ExchangeOnlineManagement” PowerShell module to use the Exchange Online PowerShell CMDLETs
- We can install “ExchangeOnlineManagement” PowerShell module using Install-Module PowerShell CMDLET
PS C:\Windows\System32> Install-Module -Name ExchangeOnlineManagement -Force
- Once we have successfully installed PowerShell module “ExchangeOnlineManagement“, we are ready to execute the Exchange Online PowerShell CMDLETs
- In below example, we are connecting to Exchange Online using “Connect-ExchangeOnline” PowerShell CMDLET
PS C:\Windows\System32> Connect-ExchangeOnline

SharePoint Online
- To execute SharePoint online PowerShell CMDLETs we need install SharePoint Online PowerShell module – Microsoft.Online.SharePoint.PowerShell

- Once we successfully installed SharePoint Online PowerShell module we are ready to execute the SharePoint online PowerShell CMDLETs
- Lets connect SharePoint site using SharePoint Online PowerShell CMDLET – Connect-SPOService

Microsoft Teams
- To execute Microsoft Teams PowerShell CMDLETs we need to install the Microsoft Teams PowerShell module – MicrosoftTeams
- We can verify if MicrosoftTeams module is installed or not using Get-Module CMDLET as
PS C:\> Get-Module -Name MicrosoftTeams -ListAvailable
Directory: C:\Users\u1086350\Documents\PowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 7.0.0 MicrosoftTeams Core,Desk {Add-TeamChannelUser, Add-TeamUser, Con…

- Once we have Microsoft Teams PowerShell module in place, we can connect to Microsoft Teams and execute Microsoft Teams PowerShell CMDLETs
- We will connect Microsoft Teams using PowerShell CMDLET – Connect-MicrosoftTeams as
PS C:\> Connect-MicrosoftTeams
Account Environment Tenant TenantId
------- ----------- ------ --------
prasham@knowledgejunction1.onmicrosoft.com AzureCloud 6b38e1c3-a1fe-40cc-8b93-a4159a50592c 6b38e1c3-a1fe-40cc-8b93-a4…

- As we successfully connects to Microsoft Teams, we are ready to execute the Microsoft Teams PowerShell CMDLETs
- Lets get all Teams in our tenant using PowerShell CMDLET – Get-Team as
PS C:\> Get-Team
GroupId DisplayName Visibility Archived MailNickName Description
------- ----------- ---------- -------- ------------ -----------
71626482-1105-47ff-b01b-9e64519ea1fc LIFE IS BEAUTIFUL Public False lifeisbeautiful LIFE IS BEAUTIFUL

REFERENCES
- PowerShell : Getting Started with PnP PowerShell Cmdlets – https://knowledge-junction.in/2025/06/04/powershell-pnp-powershell/
- PowerShell – Exploring Module CMDLETs – https://knowledge-junction.in/2022/12/12/__trashed-2/
Thanks for reading ! Stay tuned on Microsoft 365 Junction for all updates, issues, solutions and tutorials
HAVE a FANTASTIC LEARNING AHEAD!!! LIFE IS BEAUTIFUL 🙂

3 Responses
[…] PowerShell Modules / CMDLETs – Connecting to Microsoft 365 Services – https://microsoft365junction.com/2025/06/09/powershell-connecting-to-microsoft-365-services/ […]
[…] PowerShell Modules / CMDLETs – Connecting to Microsoft 365 Services – https://knowledge-junction.in/2025/06/09/powershell-connecting-to-microsoft-365-services/ […]
[…] PowerShell Modules / CMDLETs – Connecting to Microsoft 365 Services […]