Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function Get-MailboxUsage {
- $mailboxuser = Read-Host "Please enter the mailbox to check or leave blank for all mailboxes"
- $getprohibitsendquota = Read-Host "Would you like to include max mailbox capacity? (Y/N)"
- if ($getprohibitsendquota -eq "Yes") {
- $SO_Params = @{
- Property = 'DisplayName, IsArchiveMailbox, ItemCount, TotalItemSize, ProhibitSendQuota'}}
- else {
- $SO_Params = @{
- Property = 'DisplayName, IsArchiveMailbox, ItemCount, TotalItemSize'}}
- if ($mailboxuser -eq '') {
- Get-Mailbox |
- Get-MailboxStatistics |
- Select-Object @SO_params |
- Format-Table –autosize}
- else {
- Get-Mailbox $mailboxuser |
- Get-MailboxStatistics |
- Select-Object @SO_Params |
- Format-Table –autosize}
- }
Add Comment
Please, Sign In to add comment