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)
https://technet.microsoft.com/en-us/library/dn789037.aspx

 

SharePoint Online:
https://technet.microsoft.com/library/fp161364(v=office.15).aspx

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

Get-SPODeletedSite | Remove-SPODeletedSite

 

Exchange Online:
https://technet.microsoft.com/library/jj200780(v=exchg.160).aspx

Get-User -Identity “user@domain.com” | fl

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

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

Get-Mailbox -Identity “me@gregbesso.com” | fl

Get-Mailbox -Identity “me@gregbesso.com” | Get-MailboxStatistics | fl

Get-Mailbox -Identity “me@gregbesso.com” | Get-MailboxStatistics | Format-Table ItemCount, TotalDeletedItemSize, TotalItemSize, DisplayName, LastLogonTime, DatabaseIssueWarningQuota

Get-MailboxUsageReport

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}

 

 

 

Advertisement

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s