Need assistance to get mailbox usage of list of UPNs.

nav2567
nav2567 used Ask the Experts™
on
Hello,

May someone assist me with a script?

I have a CSV file which contains list of user UPNs.

I need to list out their O365 mailbox usage.  

I think this command is needed:  Get-MailboxStatistics identity UPN totalitemsize

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hardware Tester and Debugger
Commented:
Hi there! :)

Please try the following. You will need to replace the C directory with your own csv file path.

$DataPath = "C:\YourUserName\o365UserData.csv"

get-EXOmailbox -resultsize 100 | foreach-object {
  $user = $_

  $UPN = $user.userprincipalname
  $License = Get-MsolUser -userprincipalname $UPN
  $MbxStats = Get-EXOMailboxStatistics $UPN

  [pscustomobject]@{
    Name = $user.name
    UPN = $UPN
    Alias = $user.alias
    # ...
  } 

} | Export-Csv -notypeinformation -Path $DataPath

Open in new window

Kundan GuptaSenior Administrator

Commented:
Easy Option :
In the admin center, go to the Reports > Usage page.
From the Select a report drop-down, select Exchange > Mailbox usage.

Do the V-lookup wiht UPN name or SMTP.

Or use this link

https://gallery.technet.microsoft.com/office/Mailbox-Size-Report-for-ed9435e2

Regards
Kundan
NoahHardware Tester and Debugger

Commented:
Hi, did any of our suggestions work?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial