Setting Exchange mailbox size limits on a group

WHAT! I hear you say, you can’t do that! .. Very true, but you can automate it ;-) using the wonders of Powershell

Exchange 200x

First you will need to use adsiedit.msc and get the groups distinguishedName.  Once you have that, using an account that has access to over the users AD objects you run this code:
$mygroup = “
$grp = [adsi](“
LDAP://$mygroup“)

Now type:
$grp | FL *
This will list out properties of the group ** just to make sure its’ the right one **

What you can do here is type:
$grp.member
This will list the group membership.

Now choose a quota size in KB
$QuotaSize = 5242880

Then if you happy, run this code to set the quota size
forEach($xMem in $Grp.Member){Write-Host $xMem;$user = [adsi](“LDAP://$xMem“); $user.mDBUseDefaults = $False; $user.mDBStorageQuota = $QuotaSize; $user.setinfo()}
 

Exchange 2007

Exchange 2007 is a lot easier. 

Now choose a quota size in KB
$QuotaSize = 5242880

$Grp = get-group ; forEach($xMem in $Grp.Members){Write-Host $xMem; set-mailbox $xMem -IssueWarningQuota $QuotaSize}

Leave a Reply

%d bloggers like this: