Exchange Server 2007 Slideshow

  1. Function QSearch { 
  2. clear -host 
  3. Write-Host "=======================================================================" -ForegroundColor Magenta 
  4. Write-Host "     MAILBOX QUOTA INFORMATION FOR: $username                      " -ForegroundColor Green 
  5. Write-Host "=======================================================================" -ForegroundColor Magenta 
  6. $username = read-host -Prompt "Enter The User Name for the Mailbox Quota Lookup: "  
  7.  
  8. # Get the mailbox, break if it's not found 
  9. $mb = Get-Mailbox $username -ErrorAction Stop 
  10.  
  11. # Get the mailbox statistics 
  12. $mbstats = Get-MailboxStatistics $username 
  13.  
  14. # If the mailbox is using the database quotas then read them, otherwise read them from the mailbox 
  15. If ($mb.UseDatabaseQuotaDefaults -eq $true) { 
  16. clear -host 
  17. Write-Host "=======================================================================" -ForegroundColor Magenta 
  18. Write-Host "     MAILBOX QUOTA INFORMATION FOR: $username                      " -ForegroundColor Green 
  19. Write-Host "=======================================================================" -ForegroundColor Magenta 
  20. Write-Host "Default Quota Set" -ForegroundColor Green 
  21.       }  
  22.       else
  23.       $PSQuota = (Get-MailboxDatabase -Identity $mb.Database).ProhibitSendQuota.Value.ToMB() 
  24.       $PSRQuota = (Get-MailboxDatabase -Identity $mb.Database).ProhibitSendReceiveQuota.Value.ToMB() 
  25.       $WQuota = (Get-MailboxDatabase -Identity $mb.Database).issuewarningQuota.Value.ToMB() 
  26.       $size = $mbstats.TotalItemSize.Value.ToMB() 
  27.       clear -host 
  28.       Write-Host "=======================================================================" -ForegroundColor Magenta 
  29.       Write-Host "     MAILBOX QUOTA INFORMATION FOR: $username                      " -ForegroundColor Green 
  30.       Write-Host "=======================================================================" -ForegroundColor Magenta 
  31.       Write-Host "" 
  32.       Write-Host "Mailbox Of:                                " $mb.DisplayName -ForegroundColor Green 
  33.       Write-Host "Mailbox Size (MB):                         " $size -ForegroundColor Green 
  34.       Write-Host "mailbox Issue Warning Quota (MB):          " $WQuota -ForegroundColor Green 
  35.       Write-Host "mailbox Prohibit Send Quota (MB):          " $PSQuota -ForegroundColor Green 
  36.       Write-Host "mailbox Prohibit Send & Recieve Quota (MB):" $PSRQuota -ForegroundColor Green 
  37.       Write-Host "" 
  38.       Write-Host "=======================================================================" -ForegroundColor Magenta 
  39.       Write-Host "" 
  40. Function Again{  
  41. $Again = read-host -Prompt "Would you like to perform another Mailbox Quota Lookup? (Y)es or Anykey to Exit: "  
  42. If ($Again -eq "Y"){ 
  43. QSearch 
  44. Again 
  45. Else
  46. Exit 
  47. QSearch 
  48. Again 
 
Loading...
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.