Tuesday, December 6, 2022
Home Microsoft 365 Exchange Top 10 Office 365 PowerShell Commands for Admins

Top 10 Office 365 PowerShell Commands for Admins

If you are IT administrator managing Office 365 (Microsoft 365) helps you to work more efficiently. You can access to all Microsoft 365 Admin Centers through PowerShell

Here are top 10 Office 365 PowerShell Commands for Admins

1.Connecting To Exchange Online

$Cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Cred -Authentication Basic –AllowRedirection
$Cred = Get-Credential to connect Exchange Online
Connecting To Exchange Online

2.Connecting SharePoint Online with PowerShell

Install-Module -Name Microsoft.Online.SharePoint.PowerShell

$orgName="<name of your Office 365 organization, example: contosotoycompany>"
Connect-SPOService -Url https://$orgName-admin.sharepoint.com
Connecting SharePoint Online with PowerShell

3.Connecting To Azure

Install-Module -Name AzureAD
Connect-AzureAD -Confirm
Connecting To Azure

4.Get all Azure Commands

Get-Command -module AzureAD

5.List all unlicensed users

Get-MsolUser -UnlicensedUsersOnly

6.All Mailbox report

Get-mailbox | get-MailboxStatistics

7. List all groups


8.Create a new SharePoint site

New-SPOSite -Url https://contoso.sharepoint.com/sites/newsite -Owner joe.healy@contoso.com -StorageQuota 1000 -Title "New site collection"

9. Removes a user or a security group from a site collection or a group.

Remove-SPOUser -Site https://contoso.sharepoint.com/sites/newsite -LoginName joe.healy@contoso.com -Group "new site Owners"

10. Gets a device from Active Directory


For more information click here

Most Popular

Microsoft 365 All Tenants in the admin center

More than one-third of admins that use the Microsoft 365 admin center manage multiple tenants. This applies to two-thirds of enterprise customers...

Windows Defender Advanced Threat Protection (ATP) software is undergoing some changes

Microsoft has announced that its Windows Defender Advanced Threat Protection (ATP) software is undergoing some changes. The antivirus program is expanding beyond...

Improvements to SharePoint news feeds and digests

The news feed delivers an intelligent view of news, targeted to you based on factors like your role or location, and further...

Microsoft Endpoint Management Deploy an application to a device

From the Microsoft Endpoint Management admin center, you can initiate an application install in real time for a tenant attached device.