M365 Powershell Connect

Here is to connect M365 through the powershell. Installing the module is required. Please always disconnect after you are done doing the task to clear the sesson. Azure AD Connect-azureAD # Connect Azure AD Disconnect-AzureAD # Disconnect Azure AD Az Connect-AzAccount # Connect AzAccount Get-AzSubscription # Check current AZ subscription Connect-AzAccount # Disconnect AzAccount Msol Connect-MsolService # Connect MsolService [Microsoft.Online.Administration.Automation.ConnectMsolService]::ClearUserSessionState() # Disonnect MsolService Exchange Online Connect-ExchangeOnline # Connect ExchangeOnline Disconnect-ExchangeOnline # Disconnect ExchangeOnline MS Teams Install-Module -Name PowerShellGet -Force -AllowClobber Install-Module -Name MicrosoftTeams -Force -AllowClobber Ref: https://learn....

January 12, 2022 · 1 min · by Chisqi