Re: Exchange 2003: Changing the Storage Limits on multiple mailboxes at once

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



John,

Saw something similar somewhere on the web - probably windows it pro site,
and probably a script from paul robichaux. uses the same dictionary approach
as you've used in your script. this is what i ended up using.

thanks!
--
Bharat Suneja
MCSE, MCT
www.zenprise.com
blog: www.suneja.com/blog
-----------------------------------


"John Fullbright" <fullbrij@xxxxxxxxxxx> wrote in message
news:ehlVx9FLGHA.3972@xxxxxxxxxxxxxxxxxxxxxxx
I wrote a script a while back that expands nested groups recursively and
stamps addresses. Sound like the logic used to expand the nested groups
might be useful to you. I used a scripting dictionary to keep track.


' Quick and dirty script to remove the default primary smtp address,set a
new, and put the old one back as a
' secondary for each member of a nested group
' Author - fullbrij@xxxxxxxxxxx
' Creation date - 2/12/2004
'
'
' --------------------------------------------- SCRIPT
CONFIGURATION --------------------------------------------------
'
'
' strGroupDN is the DN of the group you wish to apply the changes to. You
can copy and paste the DN from ADSIEDIT
' strDefaultSuffix is the suffix suffix stamped by the recipient policy
for the domain the group is in
' strNewSuffix is the custom suffix you wish to replace the default suffix
with for strGroupDN
'
' If you need anything more complex than mailnickname as the prefix then
you must modify the script
'
' You will need to create a recipient policy for strNewSuffix with a blank
filter so Exchange will accept for delivery
'
strGroupDN = "CN=Test Group,OU=Information
Technology,OU=Users,OU=Corporate Office,DC=child,DC=mycompany,DC=com"
strDefaultSuffix = "@permutation1.com"
strNewSuffix = "@permutation2.com"
'
'
' ----------------------------------------------- END
CONFIGURATION ---------------------------------------------------
'
'
' create the dictionary and start stamping
set dicSeenGroupMember = CreateObject("Scripting.Dictionary")
StampMembers "LDAP://"; & strGroupDN, dicSeenGroupMember
'
Function StampMembers (strGroupADsPath, dicSeenGroupMember)
'
set objGroup = GetObject(strGroupADsPath)
'
for each objMember In objGroup.Members
'
' if the member is a user then stamp it
if objMember.Class = "user" then
' If the smtp address was already there as a secondary smtp
address then delete it
objMember.PutEx 4, "ProxyAddresses", Array("smtp:" &
objMember.mailnickname & strNewSuffix)
objMember.SetInfo
' put the smtp address in as a primary then set mail and
msexchpoliciesexcluded
objMember.PutEx 3, "ProxyAddresses", Array("SMTP:" &
objMember.mailnickname & strNewSuffix)
objMember.Put "mail", objMember.mailnickname & strNewSuffix
objMember.Put "msexchpoliciesexcluded",
"{26491CFC-9E50-4857-861B-0CB8DF22B5D7}"
objMember.SetInfo
' delete the old primary
objMember.PutEx 4, "ProxyAddresses", Array("SMTP:" &
objMember.mailnickname & strDefaultSuffix)
objMember.SetInfo
' add the old primary back as a secondary
objMember.PutEx 3, "ProxyAddresses", Array("smtp:" &
objMember.mailnickname & strDefaultSuffix)
objMember.setinfo
end if
'
' if it is a group then expand the group recursively
if objMember.Class = "group" then
'
if dicSeenGroupMember.Exists(objMember.ADsPath) then
' do nothing to avoid looping if we already stamped it
else
' add it to the dictionary and stamp it
dicSeenGroupMember.Add objMember.ADsPath, 1
StampMembers objMember.ADsPath, dicSeenGroupMember
end if
'
end if
'
next
'
End Function



"Bharat Suneja" <bharatsuneja@xxxxxxxxxxx> wrote in message
news:evdo$0DLGHA.1192@xxxxxxxxxxxxxxxxxxxxxxx
Well, to do this on a group has been a little more complicated because
I'm trying to implement functionality that also works with nested
groups - i.e. changes the limits on all members of nested groups as well,
without getting into a loop (where some group along the group membership
path is also a member of another nested group... ).

Will post to this thread once I'm done, or start a new one.

What it does... :
take group name and the 3 parameters - mailbox limit (you get a warning
when you cross this, attrib mDBStorageQuota), over quota limit (stop
send, mDBOverQuotaLimit), hard limit (stop send and receive,
mDBOverHardQuotaLimit) as command-line arguments.

Search AD for the group, enumerates members, checks if member is a group,
for mailbox-enabled users sets the mDBUseDefault = FALSE, sets
mdBStorageQuota, mDBOverQuotaLimit, mDBOverHardQuotaLimit.
--
Bharat Suneja
MCSE, MCT
www.zenprise.com
blog: www.suneja.com/blog
-----------------------------------------


<MatthewBrown@xxxxxxxxx> wrote in message
news:1139348075.480343.144000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
A script would be great! I don't like the idea of having to create
another Store.

Even though your script is still in development, any tips on making my
own?

We're in dire need to cap some people off before we hit said 17GB.


Thanks,

Matt







.



Relevant Pages

  • Re: Exchange 2003: Changing the Storage Limits on multiple mailboxes at once
    ... Sound like the logic used to expand the nested groups ... ' Quick and dirty script to remove the default primary smtp address,set a ... ' secondary for each member of a nested group ... ' You will need to create a recipient policy for strNewSuffix with a blank ...
    (microsoft.public.exchange.admin)
  • Re: active directory question
    ... Thank you for the time you took to review this script. ... Later you seem to use ADO to find the trustee. ... The only attribute you need retrieve is "member". ...
    (microsoft.public.scripting.vbscript)
  • Re: Script to populate Distribution list
    ... that list several diffrent zip codes for the same location is there a way to ... > ' Check if user already a member of the group. ... This would slow the script ... > methods require the AdsPath of the user. ...
    (microsoft.public.scripting.vbscript)
  • Re: Error using LDAP query
    ... I know you said this line is failing: ... CreateObject) failed to set oADSysInfo to a valid object. ... try running this simple script as a user (non-Domain ... >> member of at least 2 other groups, ...
    (microsoft.public.windows.server.scripting)
  • Re: Login Script group membership
    ... Would it be more managable to write this as a vbs instead of a batch file? ... script, as not all o/s's can run a .vbs file directly as a logon script. ... - you'd need to write a wrapper function to invoke ifmember and return the ... In the general case a user can be a member of any number of ...
    (microsoft.public.windows.server.scripting)