tr6boy
(Starting to like KiXtart)
2002-12-02 03:59 PM
Exch 2000 Mailbox Attribute

Hi folks, anyone know how I could query the AD to return who has the default mailbox size limit enabled? I think the attribute is msExchMailboxManagerSizeLimitEnabled, but I can't get it to return any value. Thanks!

Bonji
(Starting to like KiXtart)
2002-12-03 01:18 PM
Re: Exch 2000 Mailbox Attribute

This applies to Exchange 2000...

Here's some code to view the storage settings for an Exchange user. You will need to modify the LDAP path to be valid for your domain.

code:
BREAK ON

$adsUser = GetObject("LDAP://CN=USER,OU=OrgUnit,DC=DOMAIN,DC=COM")
$adsUser.GetInfo

? $adsUser.FullName ; Fullname of User
? $adsUser.mailNickname ; Exchange Alias
? $adsUser.mDBUseDefaults ; Does this user use the store defaults
? $adsUser.mDBStorageQuota ; When to issue a warning
? $adsUser.mDBOverQuotaLimit ; When to prevent sending
? $adsUser.mDBOverHardQuotaLimit ; When to prevent sending and receiving

$adsUser = Nothing

This should get you over the hump.

-Ben
http://www.rgcweb.org/kix


tr6boy
(Starting to like KiXtart)
2002-12-03 03:04 PM
Re: Exch 2000 Mailbox Attribute

over the bump, and really flying now!! Thanks Ben, I greatly appreciate the help.

Regards,
MC


tr6boy
(Starting to like KiXtart)
2002-12-03 08:11 PM
Re: Exch 2000 Mailbox Attribute

Ben, one other quick question if I may - mDBOverHardQuotaLimit has an Integer value between 0 and x when it is set, but how would I programatically "uncheck" that particular attribute? (Now that I showed the manager how many users are set this way, she wants to uncheck just that attribute so mail is never refused due to a full mailbox, but doesn't want to do it by hand as there are *many*).

I tried userObj.mDBOverHardQuotaLimit = NULL but that didn't work. Thanks again...


Sealeopard
(KiX Master)
2002-12-03 08:18 PM
Re: Exch 2000 Mailbox Attribute

Why don't you set the mail quotas site-wide instead of separately for each user?

tr6boy
(Starting to like KiXtart)
2002-12-03 08:35 PM
Re: Exch 2000 Mailbox Attribute

Jens, not sure if this answers you correctly or not, as I am not very Exchange-savvy

Most users are set to use the defaults, but there are other users that are not, for various business reasons, as I understand it. Wouldn't site-wide prevent me from providing the custom limits for those users? She doesn't want everyone to be set the same; it's just that the ones that have custom limits should never be prevented from receiving mail.

Please advise if I'm not on traget here though. Thanks!


Sealeopard
(KiX Master)
2002-12-03 08:50 PM
Re: Exch 2000 Mailbox Attribute

No, you're on target, wasn't aware that you just want to modify some 'special' mailboxes.

Bonji
(Starting to like KiXtart)
2002-12-04 01:44 PM
Re: Exch 2000 Mailbox Attribute

Setting any of the values to -1 turns it off. It will show a -1 in the Microsoft OU tool (vs a blank), but that is OK as that is the correct value for it to be off. Here's some updated code...

code:
BREAK ON

$adsUser = GetObject("LDAP://CN=USER,OU=OrgUnit,DC=DOMAIN,DC=COM")
$adsUser.GetInfo

? $adsUser.FullName ; Fullname of User
? $adsUser.mailNickname ; Exchange Alias
? $adsUser.mDBUseDefaults ; Does this user use the store defaults
? $adsUser.mDBStorageQuota ; When to issue a warning
? $adsUser.mDBOverQuotaLimit ; When to prevent sending
? $adsUser.mDBOverHardQuotaLimit ; When to prevent sending and receiving

$adsUser.mDBOverHardQuotaLimit = -1
$adsUser.SetInfo
? @SERROR + " : " + @ERROR ; Verify changes were accepted
? $adsUser.mDBOverHardQuotaLimit ; Updated setting

$adsUser = Nothing

-Ben
http://www.rgcweb.org/kix

[ 04. December 2002, 13:46: Message edited by: Ben Dulaney ]


tr6boy
(Starting to like KiXtart)
2002-12-04 03:09 PM
Re: Exch 2000 Mailbox Attribute

Ben, you're awesome. Thanks so much for the help!

Happy holidays!
MC


tr6boy
(Starting to like KiXtart)
2002-12-04 09:56 PM
Re: Exch 2000 Mailbox Attribute

Well, thought I was done ;-)

Interesting issue - if I set the attribute to -1 per the above code (thanks again Ben), it works, but if someone attempts to then use the GUI to make a change to any of the other fields, clicking OK will prompt that the -1 is not valid. I guess if they ever do that, they could then take the opportunity to "clear" it manually, which is a valid value...is that the answer? Seems strange that one value is valid in the GUI and another only programmatically.


Bonji
(Starting to like KiXtart)
2002-12-06 04:07 PM
Re: Exch 2000 Mailbox Attribute

Yes, that is very strange. It appears the only solution is that each scenario requires a unique solution. This is very annoying, and I cannot find a one-size-fits-all fix.

I guess we have to tough this one out.

-Ben
http://www.rgcweb.org/kix


tr6boy
(Starting to like KiXtart)
2002-12-06 04:14 PM
Re: Exch 2000 Mailbox Attribute

Fair enough - that also seems to be the concensus from other sources. But if anyone else comes up with a solution, I'll certainly pass it on. Thanks!