How to set mailbox size limits on a group?

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?
numb3rs1xAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
exx1976Connect With a Mentor Commented:
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
 
JoWickermanCommented:
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
 
rakeshmiglaniCommented:
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
Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

 
flaphead_comCommented:
or you could run a powershell script that will set the issue warning level for the group members?!
0
 
gupnitCommented:
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
 
gupnitCommented:
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
 
flaphead_comCommented:
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
 
gupnitCommented:
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
 
flaphead_comCommented:
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
 
numb3rs1xAuthor Commented:
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
 
exx1976Commented:
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
 
numb3rs1xAuthor Commented:
That would be great. I'm not up to speed enough on code writing.
0
 
exx1976Commented:
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
 
flaphead_comCommented:
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
 
numb3rs1xAuthor Commented:
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
 
exx1976Commented:
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
 
numb3rs1xAuthor Commented:
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
 
numb3rs1xAuthor Commented:
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
 
numb3rs1xAuthor Commented:
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
 
exx1976Commented:
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
 
numb3rs1xAuthor Commented:
So I set it back and I got a runtime error:

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


0
 
numb3rs1xAuthor Commented:
It worked! That is awesome. Thank you very much!
0
All Courses

From novice to tech pro — start learning today.