mardi 29 novembre 2011

Connaitre les quotas des boites mails

Si vous chercher a connaitre les quotas appliqués à vos utilisateurs sur exchange 2010, le script suivant pourra vous aidé.

Il vous permet de récupéré soit les quotas présent au niveau des Databases exchange, soit au niveau de l'utilisateur:


$bals=Get-Mailbox
$MailboxQuotas=@()
foreach ( $bal in $bals){
$stats=$bal|Get-MailboxStatistics
$DB=(Get-MailboxDatabase -Identity $stats.Database)
If ($bal.UseDatabaseQuotaDefaults -eq $true) {
$ProhibitSendQuota = $DB.ProhibitSendQuota.Value.ToMB()
$IssueWarningQuota = $DB.IssueWarningQuota.Value.ToMB()
$ProhibitSendReceiveQuota = $DB.ProhibitSendReceiveQuota.Value.ToMB()
} else {
if ($bal.ProhibitSendQuota.IsUnlimited -eq $True){
$IssueWarningQuota = "Unlimited"
}else{
$ProhibitSendQuota = $bal.ProhibitSendQuota.Value.ToMB()
}
if ($bal.IssueWarningQuota.IsUnlimited -eq $True){
$IssueWarningQuota = "Unlimited"
}else{
$IssueWarningQuota = $bal.IssueWarningQuota.Value.ToMB()
}
if ( $bal.ProhibitSendReceiveQuota.IsUnlimited -eq $True){
$IssueWarningQuota = "Unlimited"
}else{
$ProhibitSendReceiveQuota = $bal.ProhibitSendReceiveQuota.Value.ToMB()
}
}

$d=New-Object PSObject
$d | Add-Member -Name DisplayName -MemberType NoteProperty -Value $bal.DisplayName
$d | Add-Member -Name ProhibitSendQuota -MemberType NoteProperty -Value $ProhibitSendQuota
$d | Add-Member -Name IssueWarningQuota -MemberType NoteProperty -Value $IssueWarningQuota
$d | Add-Member -Name ProhibitSendReceiveQuota -MemberType NoteProperty -Value $ProhibitSendReceiveQuota
$MailboxQuotas+=$d
}
$MailboxQuotas



Aucun commentaire:

Enregistrer un commentaire