Site Tools


quota_einer_mailbox_aendern

Mit dem Script kann man recht easy die Quota für Mailboxen ändern. Im ersten Schritt wird die UserID der betroffenen Mailbox oder ihr Name eingegeben. Im zweiten wird die jetzige Größe der Mailbox angezeigt und ob sie am Limit ist. Im dritten Schritt kann man dann aus 12 verschiedenen Optionen wählen, was man möchte.

quotachange_mailbox.ps1
Write-Host "Mit dem Script kann man recht easy die Quota für Mailboxen ändern.
Im ersten Schritt wird die UserID der betroffenen Mailbox oder ihr Name eingegeben.
Im zweiten wird die jetzige Größe der Mailbox angezeigt und ob sie am Limit ist.
Im dritten Schritt kann man dann aus 12 verschiedenen Optionen wählen, was man möchte.
10 verschiedene Optionen zu Größenänderungen in 500MB Schritten
Option 11 Auf Standard zurück setzen
Option 12 Abbrechen und zur Konsole wechseln um es manuell zu ändern." -foreground "green"
Write-Host
write-host
 
$User = Read-Host -Prompt 'UserID of Account to be Quotachanged'
 
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
 
Get-Mailbox $user | Get-MailboxStatistics | fl totalitemsize,storagelimitstatus
 
#FL added next line 12.09.2016
Get-Mailbox $user | fl Displayname,UseDatabaseQuotaDefaults,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,Servername,Database
 
 
Write-Host "1. 1.5 GB! Send, 1.0 GB Warn" -foreground "yellow"
Write-Host "2. 2.0 GB! Send, 1.5 GB Warn" -foreground "yellow"
Write-Host "3. 2.5 GB! Send, 2.0 GB Warn" -foreground "yellow"
Write-Host "4. 3.0 GB! Send, 2.5 GB Warn" -foreground "yellow"
Write-Host "5. 3.5 GB! Send, 3.0 GB Warn" -foreground "yellow"
Write-Host "6. 4.0 GB! Send, 3.5 GB Warn" -foreground "yellow"
Write-Host "7. 4.5 GB! Send, 4.0 GB Warn" -foreground "yellow"
Write-Host "8. 5.0 GB! Send, 4.5 GB Warn" -foreground "yellow"
Write-Host "9. 5.5 GB! Send, 5.0 GB Warn" -foreground "yellow"
Write-Host "10.6.0 GB! Send, 5.5 GB Warn" -foreground "yellow"
Write-Host
Write-Host "11.Auf Standard zurücksetzen" -foreground "yellow"
write-host
Write-Host "12.Abbruch und händisch ändern" -foreground "yellow"
Write-Host
write-host
 
 
$auswahl = read-host -Prompt 'Neue Quota wählen'
 
if ($auswahl -eq 1)     {Set-Mailbox -IssueWarningQuota '1.318 GB (1,415,577,600 bytes)' -ProhibitSendQuota '1.465 GB (1,572,864,000 bytes)' -ProhibitSendReceiveQuota '1.953 GB (2,097,152,000 bytes)' -UseDatabaseQuotaDefaults $false -Identity $user}
elseif ($auswahl -eq 2) {Set-Mailbox -IssueWarningQuota '1.66 GB (1,782,579,200 bytes)' -ProhibitSendQuota '1.953 GB (2,097,152,000 bytes)' -ProhibitSendReceiveQuota '2.93 GB (3,145,728,000 bytes)' -UseDatabaseQuotaDefaults $false -Identity $user}
elseif ($auswahl -eq 3) {Set-Mailbox -IssueWarningQuota '1.953 GB (2,097,152,000 bytes)' -ProhibitSendQuota '2.441 GB (2,621,440,000 bytes)' -ProhibitSendReceiveQuota '3.418 GB (3,670,016,000 bytes)' -UseDatabaseQuotaDefaults $false -Identity $user}
elseif ($auswahl -eq 4) {Set-Mailbox -IssueWarningQuota '2.441 GB (2,621,440,000 bytes)' -ProhibitSendQuota '2.93 GB (3,145,728,000 bytes)' -ProhibitSendReceiveQuota '3.906 GB (4,194,304,000 bytes)' -UseDatabaseQuotaDefaults $false -Identity $user}
elseif ($auswahl -eq 5) {Set-Mailbox -IssueWarningQuota '2.93 GB (3,145,728,000 bytes)' -ProhibitSendQuota '3.418 GB (3,670,016,000 bytes)' -ProhibitSendReceiveQuota '4.395 GB (4,718,592,000 bytes)' -UseDatabaseQuotaDefaults $false -Identity $user}
elseif ($auswahl -eq 6) {Set-Mailbox -IssueWarningQuota '3.418 GB (3,670,016,000 bytes)' -ProhibitSendQuota '3.906 GB (4,194,304,000 bytes)' -ProhibitSendReceiveQuota '4.883 GB (5,242,880,000 bytes)' -UseDatabaseQuotaDefaults $false -Identity $user}
elseif ($auswahl -eq 7) {Set-Mailbox -IssueWarningQuota '3.906 GB (4,194,304,000 bytes)' -ProhibitSendQuota '4.395 GB (4,718,592,000 bytes)' -ProhibitSendReceiveQuota '5.371 GB (5,767,168,000 bytes)' -UseDatabaseQuotaDefaults $false -Identity $user}
elseif ($auswahl -eq 8) {Set-Mailbox -IssueWarningQuota '4.395 GB (4,718,592,000 bytes)' -ProhibitSendQuota '4.883 GB (5,242,880,000 bytes)' -ProhibitSendReceiveQuota '5.859 GB (6,291,456,000 bytes)' -UseDatabaseQuotaDefaults $false -Identity $user}
elseif ($auswahl -eq 9) {Set-Mailbox -IssueWarningQuota '4.883 GB (5,242,880,000 bytes)' -ProhibitSendQuota '5.371 GB (5,767,168,000 bytes)' -ProhibitSendReceiveQuota '6.348 GB (6,815,744,000 bytes)' -UseDatabaseQuotaDefaults $false -Identity $user}
elseif ($auswahl -eq 10) {Set-Mailbox -IssueWarningQuota '5.371 GB (5,767,168,000 bytes)' -ProhibitSendQuota '5.859 GB (6,291,456,000 bytes)' -ProhibitSendReceiveQuota '6.836 GB (7,340,032,000 bytes)' -UseDatabaseQuotaDefaults $false -Identity $user}
elseif ($auswahl -eq 11) {Set-Mailbox -IssueWarningQuota 'unlimited' -ProhibitSendQuota 'unlimited' -ProhibitSendReceiveQuota 'unlimited' -UseDatabaseQuotaDefaults $true -Identity $user}
else {
  Write-Host "Bitte Änderung manuell in der Konsole durchführen"
}
 
Write-Host "Quota changed"
 
Write-Host "Press any key to continue ..."
 
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
quota_einer_mailbox_aendern.txt · Last modified: 2017/01/17 10:44 by clemens