Useful Office 365 PowerShell Commands

There are many things you can do with PowerShell related to Office 365 services, and I want to keep track of the ones that are most useful (for me) in one page. So, that is what this page here is for…

Useful links:

Cmdlet references for Office 365 services (TechNet)


SharePoint Online:

Get-SPOSite -Identity “https://server/sites/siteName” | fl

Get-SPODeletedSite | Remove-SPODeletedSite


Exchange Online:

Get-User -Identity “” | fl

Get-DistributionGroup -Identity “BodoBeers Contact Us” | fl

Get-DistributionGroupMember -Identity “BodoBeers Contact Us” | Get-User | Format-Table UserPrincipalName

Get-Mailbox -Identity “” | fl

Get-Mailbox -Identity “” | Get-MailboxStatistics | fl

Get-Mailbox -Identity “” | Get-MailboxStatistics | Format-Table ItemCount, TotalDeletedItemSize, TotalItemSize, DisplayName, LastLogonTime, DatabaseIssueWarningQuota


Get-MailTrafficReport -StartDate 05/10/2016 -EndDate 5/17/2016 -SummarizeBy EventType | Format-Table Date, Direction, MessageCount

Get-ConnectionByClientTypeReport -StartDate 05/10/2016 -EndDate 05/17/2016 | Where {$_.Count -gt 0}





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s