Get specific user’s specific folder size

Hi, Thsi is a powershell to check specific system folder current size on office 365 online outlook.

It needs some variables as $userPrincipalName , $folderName , with this variables I make powershell.

$userPrincipalName = “”                                                                                                $folderName = Inbox”                                                                                                                                 Get -MailFolderStatistics -Identity  $userPrincipalName | where { -match $folderName} | select Identity,  Name, FolderSize, ItemFolderSize

It returns specific user’s specific folder size with Identity, Name, ItemFolderSize properties using select cmdlet.   And it uses Get-MailFolderStatistics cmdlet.

If you want to get specific folder size with multiple users, you need to use csv file with userPrincipalName attribute and values.

  1. Create csv file , create a column set attribute name userPrincipalName, then set values about Exchange UserPrincipalName, and save as csv file.
  2. Get objects one bye one using import-csv cmdlet
  3. Use ForEach-Object cmdlet to looping specific cmdelt
  4. Execute cmdlet to retrieve specific folder size
  5. Export this information to other csv file using Out-File cmdlet

$users = Import-Csv d:\AllUsers.csv

$users | ForEach-Object {
 Get-MailboxFolderStatistics -Identity $_.userPrincipalName | where {$ -match “Inbox”} | Select Identity, Name, FolderSize, ItemFolderSize
} |   Out-File D:\Inbox.csv

In this case , you need to check  $_.userPrincipalName format, plz find this format when will you use on the google.


글쓴이: hongwoo jin

I'm managing our Korea company's Office 365 administrator I want to be MS Office 365 & SharePoint MVP with certification.

답글 남기기

아래 항목을 채우거나 오른쪽 아이콘 중 하나를 클릭하여 로그 인 하세요: 로고

WordPress.com의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Google+ photo

Google+의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Twitter 사진

Twitter의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )

Facebook 사진

Facebook의 계정을 사용하여 댓글을 남깁니다. 로그아웃 /  변경 )


%s에 연결하는 중