Solved

How to set mailbox size limits on a group?

Posted on 2008-10-16
22
1,210 Views
Last Modified: 2012-05-05
I see in the Exchange General tab under each user an option to issue warnings or more when the user reaches a certian inbox size. Is there a way to set that to a group?
0
Comment
Question by:numb3rs1x
  • 8
  • 5
  • 4
  • +3
22 Comments
 
LVL 16

Expert Comment

by:JoWickerman
ID: 22738032
Hi numb3rs1x,

Yes there is, but you'll have to create a seperate information store, move the group's mailboxes to this store and set a limit on the store. If you need help performing this, please let me know.

Cheers
0
 
LVL 35

Expert Comment

by:rakeshmiglani
ID: 22738368
no.
because groups don't have mailboxes and they don't store emails so they don't have any type of storage allocated to them.
0
 
LVL 7

Expert Comment

by:flaphead_com
ID: 22739931
or you could run a powershell script that will set the issue warning level for the group members?!
0
 
LVL 32

Expert Comment

by:gupnit
ID: 22740206
Hi,
There is nothing by term group mailboxes.
I assume that you mean the all users who are part of a particular Group should be having same size limits.
Thanks
Nitin
 
0
 
LVL 32

Expert Comment

by:gupnit
ID: 22740224
Use mailbox mgmt
http://www.msexchange.org/tutorials/Mailbox-Management.html
No other go....or else follow first comment (well I would not  do that though)
Thanks
Nitin
0
 
LVL 7

Expert Comment

by:flaphead_com
ID: 22740655
So manybe wrongly assuming Exchange 2007


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

Open in new window

0
 
LVL 32

Expert Comment

by:gupnit
ID: 22740720
Hi Flaphead_com,
True very true...your command is spot on, I was tempted to give that too, unfortunately our friend uses Exchange 2003. !
Cheers
Nitin
0
 
LVL 7

Expert Comment

by:flaphead_com
ID: 22741394
okay now with "normal" powershell ;-)

Remember to test this in a lab before production as this is changing user maibox attributes!!

So IssueWarningQuota is actually mDBStorageQuota in the AD


$grp = [adsi]("LDAP://<GroupDN>"); forEach($xMem in $Grp.Member){Write-Host $xMem;$user = [adsi]("LDAP://$xMem"); $user.mDBUseDefaults = $False; $user.mDBStorageQuota = 5242880; $user.setinfo()}

Open in new window

0
 

Author Comment

by:numb3rs1x
ID: 22741493
You'll have to bear with me here. Where should I issue this command, and what do I need to change to specify my environment?
0
 
LVL 18

Expert Comment

by:exx1976
ID: 22742516
You could always use a piece of VBS that would take a group name as input (or hard code it, whichever), and then would go and grab all the group member's accounts and configure them for you..  Not that hard.  Let me know if you want the code.
0
 

Author Comment

by:numb3rs1x
ID: 22743654
That would be great. I'm not up to speed enough on code writing.
0
 
LVL 18

Expert Comment

by:exx1976
ID: 22744352
Easy.  Code is below.  You'll need to put the name of the group in line 1 (replace MyGroup), and put the limits you want on lines 2, 3 and 4.  The values are in KB.

Enjoy!
GroupName = "MyGroup"

IssueWarning = 75000

ProhibitSend = 125000           'enter a 0 if you do not want to set this property

ProhibitSendAndReceive = 175000       'enter a 0 if you do not want to set this Property

Set oNetwork = CreateObject("Wscript.Network")

Domain = oNetwork.UserDomain

GroupDN = GetObjectDN(GroupName,Domain)

Set oGroup = GetObject("LDAP://" & GroupDN)

Set ArrMembers = oGroup.Members

For Each member In ArrMembers

	Member.mDBUserDefaults = False

	Member.mDBStorageQuota = IssueWarning

	If ProhibitSend > 0 Then Member.mDBOverQuotaLimit = ProhibitSend

	If ProhibitSendAndReceive > 0 Then Member.mDBOverHardQuotaLimit = ProhibitSendAndReceive

	Member.setInfo()

Next
 

Function GetObjectDN(strObject, strDomain)

	On Error Resume Next : Err.Clear

	Set objNameTranslate = CreateObject("NameTranslate")

 	objNameTranslate.Init 3, ""

	objNameTranslate.Set 3, strdomain & "\" & strObject

	strObjectDN = objNameTranslate.Get(1)

	If Err.Number <> 0 Then

		strObjectDN = ""

	End If

 	Set objNameTranslate = Nothing

	On Error Goto 0

 	GetObjectDN = strObjectDN

End Function

Open in new window

0
 
LVL 7

Expert Comment

by:flaphead_com
ID: 22757577
Okay you just need to download Windows Powershell, and you could put it on an Exchange server or a desktop that can see the AD.

Now to start with, 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 = "<groupDN">
$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()}
 

0
 

Author Comment

by:numb3rs1x
ID: 22760027
exx1976:

I tried this script you submitted. I'm not sure if I did it correctly. Do I run this on the Exchange Server or just any server that has AD? Should I see the results when I look at the Exchange settings in the user's account?
0
 
LVL 18

Expert Comment

by:exx1976
ID: 22760504
You can run it from any machine in the domain, but the account that runs it must have proper permissions to make those changes in AD.

0
 

Author Comment

by:numb3rs1x
ID: 22761122
Ok. that's what I did, and I have the proper permissions. I must have entered something wrong. I will take a look at it when I get a chance.
0
 

Author Comment

by:numb3rs1x
ID: 22777499
exx1976:

I think I need some details, so let's say my group's name is "InboxLimit" and it's in the default Users folder, and my domain is "my.domain.com". I will show you how I have it written in the script and you can correct me if I've got the wrong synax:

GroupName = "InboxLimit"
IssueWarning = 5000
ProhibitSend = 0           'enter a 0 if you do not want to set this property
ProhibitSendAndReceive = 0       'enter a 0 if you do not want to set this Property
Set oNetwork = CreateObject("Wscript.Network")
Domain = omy.domain.com
GroupDN = GetObjectDN(GroupName,Domain)
Set oGroup = GetObject("LDAP://" & GroupDN)
Set ArrMembers = oGroup.Members
For Each member In ArrMembers
        Member.mDBUserDefaults = False
        Member.mDBStorageQuota = IssueWarning
        If ProhibitSend > 0 Then Member.mDBOverQuotaLimit = ProhibitSend
        If ProhibitSendAndReceive > 0 Then Member.mDBOverHardQuotaLimit = ProhibitSendAndReceive
        Member.setInfo()
Next
 
Function GetObjectDN(strObject, strDomain)
        On Error Resume Next : Err.Clear
        Set objNameTranslate = CreateObject("NameTranslate")
        objNameTranslate.Init 3, ""
        objNameTranslate.Set 3, strdomain & "\" & strObject
        strObjectDN = objNameTranslate.Get(1)
        If Err.Number <> 0 Then
                strObjectDN = ""
        End If
        Set objNameTranslate = Nothing
        On Error Goto 0
        GetObjectDN = strObjectDN
End Function


Should that work? It seems like there is something more that should be specified.
0
 

Author Comment

by:numb3rs1x
ID: 22777527
Oh, and this is from a second try. The first time, I only changed the group name to "InboxLimit" like you had instructed in the initial posting.
0
 
LVL 18

Expert Comment

by:exx1976
ID: 22778188
You weren't supposed to change the  "Domain =" line.  That's why it doesn't work.  Put it back the way I wrote it and you should be fine.
0
 

Author Comment

by:numb3rs1x
ID: 22780105
So I set it back and I got a runtime error:

"object doesn't support this property or method:' member.mDBuserdefaults'
code:800A01B6"


0
 
LVL 18

Accepted Solution

by:
exx1976 earned 500 total points
ID: 22780259
D'oh!!

My apologies, there was a typo in that line.  It should be "member.mDBUseDefaults" not ..UserDefaults..

Code below


GroupName = "MyGroup"

IssueWarning = 75000

ProhibitSend = 125000           'enter a 0 if you do not want to set this property

ProhibitSendAndReceive = 175000       'enter a 0 if you do not want to set this Property

Set oNetwork = CreateObject("Wscript.Network")

Domain = oNetwork.UserDomain

GroupDN = GetObjectDN(GroupName,Domain)

Set oGroup = GetObject("LDAP://" & GroupDN)

Set ArrMembers = oGroup.Members

For Each member In ArrMembers

	Member.mDBUseDefaults = False

	Member.mDBStorageQuota = IssueWarning

	If ProhibitSend > 0 Then Member.mDBOverQuotaLimit = ProhibitSend

	If ProhibitSendAndReceive > 0 Then Member.mDBOverHardQuotaLimit = ProhibitSendAndReceive

	Member.setInfo()

Next

 

Function GetObjectDN(strObject, strDomain)

	On Error Resume Next : Err.Clear

	Set objNameTranslate = CreateObject("NameTranslate")

 	objNameTranslate.Init 3, ""

	objNameTranslate.Set 3, strdomain & "\" & strObject

	strObjectDN = objNameTranslate.Get(1)

	If Err.Number <> 0 Then

		strObjectDN = ""

	End If

 	Set objNameTranslate = Nothing

	On Error Goto 0

 	GetObjectDN = strObjectDN

End Function

Open in new window

0
 

Author Comment

by:numb3rs1x
ID: 22781364
It worked! That is awesome. Thank you very much!
0

Join & Write a Comment

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now