mailbox report

is there a way for both on-prem exchange of office 365 to run a simple command to show all mailboxes that currently reside on your servers/office365 environment, including the size of the mailbox?
LVL 3
pma111Asked:
Who is Participating?
 
Jose Gabriel Ortega CCEO Faru Bonon ITCommented:
Nope you will need to combine both (on-prem commands with the connection and o365 connectors)


$Onprem=@()
$Onprem+=get-mailboxdatabase | Get-MailboxStatistics | select DisplayName,TotalItemsize,itemcount

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session

$Onprem+=get-mailboxdatabase | Get-MailboxStatistics | select DisplayName,TotalItemsize,itemcount

Remove-PSSession $Session
$Onprem

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.