In the previous blog "Get Mailbox Size for an account in Exchange 2010", we talked on how to get the mailbox size for 1 user using the Microsoft Exchange Shell of Exchange 2010.
Now, we will explain how to get the mailbox size for a list of users.
It is very simple, Have the list of users sorted by line in a text file.
An example of the text file ITDepartment.txt file:
ITServices Montreal
Networking Montreal
Exchange2010 Montreal
where "ITServices Montreal"is the display name of the user. You can also use the email address, or the user principal name instead of the display name.We will the place the ITDepartment.txt file in the C:\Scripts folder.
What we need to do first is to get the list of the users inside this text file:
Try the command:
Get-Content "C:\Scripts\ITDepartment.txt"
The result will be:
[PS] C:\windows\system32>Get-Content "C:\scripts\ITDepartment.txt"
ITServices Montreal
Networking Montreal
Exchange2010 Montreal
[PS] C:\windows\system32>
Now for each line resulted from the Get-Content command, we need to run the MailboxStatistics, so we use the "|"
Now try the whole command:
[PS] C:\windows\system32>Get-Content "C:\Scripts\ITDepartment.txt" | Get-MailboxStatistics | Format-List -property displayName, TotalItemSize
DisplayName : ITServices Montreal
TotalItemSize : 61.18 MB (64,155,174 bytes)
DisplayName : Networking Montreal
TotalItemSize : 163 MB (170,937,036 bytes)
DisplayName : Exchange2010 Montreal
TotalItemSize : 25.03 MB (26,243,124 bytes)
[PS] C:\windows\system32>
I invite you to read another blog about recruitment and how to find a job
http://findonejob.blogspot.ca/
I hope this blog was helpful, and I would like to thank you for reading.
Now, we will explain how to get the mailbox size for a list of users.
It is very simple, Have the list of users sorted by line in a text file.
An example of the text file ITDepartment.txt file:
ITServices Montreal
Networking Montreal
Exchange2010 Montreal
where "ITServices Montreal"is the display name of the user. You can also use the email address, or the user principal name instead of the display name.We will the place the ITDepartment.txt file in the C:\Scripts folder.
What we need to do first is to get the list of the users inside this text file:
Try the command:
Get-Content "C:\Scripts\ITDepartment.txt"
The result will be:
[PS] C:\windows\system32>Get-Content "C:\scripts\ITDepartment.txt"
ITServices Montreal
Networking Montreal
Exchange2010 Montreal
[PS] C:\windows\system32>
Now for each line resulted from the Get-Content command, we need to run the MailboxStatistics, so we use the "|"
Now try the whole command:
[PS] C:\windows\system32>Get-Content "C:\Scripts\ITDepartment.txt" | Get-MailboxStatistics | Format-List -property displayName, TotalItemSize
DisplayName : ITServices Montreal
TotalItemSize : 61.18 MB (64,155,174 bytes)
DisplayName : Networking Montreal
TotalItemSize : 163 MB (170,937,036 bytes)
DisplayName : Exchange2010 Montreal
TotalItemSize : 25.03 MB (26,243,124 bytes)
[PS] C:\windows\system32>
I invite you to read another blog about recruitment and how to find a job
http://findonejob.blogspot.ca/
I hope this blog was helpful, and I would like to thank you for reading.