none
How to get mailboxsize,overlimit,mDBStorageQuota,mDBOverHardQuotaLimit,MailboxItems,logonCount? RRS feed

  • Question

  • Hi,
    I need to retreview the following informations(all mailbox) from Exchange Server 2010 and 2007. I know it is very easy if I use powershell But My MD says dont want use Powershell cmltds try some other approachs like Webservice, LDAP query, or else.

    So how can I do this?

    mailboxsize,
    overlimit,
    mDBStorageQuota,
    mDBOverQuotaLimit,
    mDBOverHardQuotaLimit,
    MailboxItems,
    logonCount.

    I have developed Exchange webservice task using VS2010 for some other process..

    SO Pls help me or guide me which method will give the above results for Exchange Server 2010 & 2007

    I am here for your answer..


    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful"

    Saturday, June 30, 2012 7:23 AM

Answers

  • MailboxSize, Mailbox Items Count

    With EWS you can't get these directly (eg there is no equivalent of doing a GetMailboxTable in Mapi with EWS so you can't access those top level properties which include the logon details like you would in Mapi). The only thing you can do in EWS is access the Size of each Mailbox Folder and then add them together to get the mailbox size see http://social.technet.microsoft.com/Forums/fi-FI/exchangesvrdevelopment/thread/b4a10ba2-8ae7-40e7-9408-f198a5b9ce10 . This uses the EWS Managed API which you can download from http://www.microsoft.com/en-us/download/details.aspx?id=30141. Doing this for every mailbox on a Server is going to be slow and require you to have Full Access to every mailbox.

    Disabled mailboxes - You would need to use LDAP to get these use the Bitwise Ldap filter (UserAccountControl:1.2.840.113556.1.4.803:=2)  see http://support.microsoft.com/kb/269181 then check other properties to see if its a Mailbox Enalbed account (note Meeting Room/Resource Mailboxes will be disabled by default so be carefull)

    Mailbox Folders Properties - What properties ?

    Public Folders Size Report, Empty Public Folders - With Public folders you can't do a deep traversal so you need to start at the Root public folder then do shallow traversal of every folder within the Tree(this can be quite a lengthy process) there a EWS Managed API script in http://technet.microsoft.com/en-us/library/hh547012 that demonstrates that.

    Cheers
    Glen

    • Marked as answer by P Elayaraja Wednesday, July 4, 2012 7:25 AM
    Wednesday, July 4, 2012 6:14 AM

All replies

  • The Exchange Management Shell cmdlets act as the Management API for accessing Exchange Management data and is what the Exchange Management Console uses to perform all its tasks. (ECP also makes use the EMS cmdlets) so the technically correct and recommended way of accessing this information if via the cmdlets. If you want to do this from Managed code here see http://msdn.microsoft.com/en-us/library/ff326159(v=exchg.140).aspx and http://blogs.technet.com/b/exchange/archive/2009/11/02/3408653.aspx

    Does your MD have a Technical reason for not using the Cmdlets ? if so what is it ? this maybe something someone in the group can help point him in the right direction on.

     As for (Web Service, LDAP query, or else.)

    With Exchange Web Services you could compile the MailboxSize and Mailbox Items Count by getting all the foldersize and adding them together but this would be very slow for a large number of mailboxes.

    overlimit,
    mDBStorageQuota,
    mDBOverQuotaLimit,
    mDBOverHardQuotaLimit,

    All these values are held in Active Directory but depending on how the quotas are configured they will be held on different objects. Eg they will be on the MailboxStore Object or the User object so you could use LDAP via System.DirectoryService to retrieve these.

    The other thing you can use is MAPI (not supported in C# however so you need to use C++) eg use a Get-MailboxTable eg http://support.microsoft.com/kb/320071 (You can test what you can get out of the MailboxTable using MFCMapi http://mfcmapi.codeplex.com/

    Cheers
    Glen

    Monday, July 2, 2012 6:56 AM
  • Thanks MR Glen Scales..

    Already We have developed a task using Powershell cmlets and it is same as your reffered links, and it will works well. In That we wants to run the same Exchange 2010 remote power shell concepts for Exchange 2007. But We all know Exchange 2007 did not supports the Remote powershell and works with localy only.

    Also we have developed( 6 yrs before ) a task using MAPI and still it works fine at any remote locations.

     But now our MD feel to remove the MAPI code and wants to add some other method for the mentioned reports. cmdlts is well only for 2010. But our MD wants to the same for Exchange 2007 too. I dont know which method can I use?

    I hopw I have explained clearly.

    Please Giude Me Mr Glen Scales.....

     


    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful"

    Monday, July 2, 2012 1:30 PM
  • On 2007 if you don't want to run your cmdlet code locally you can install the Exchange Admin tools on a non Exchange server http://technet.microsoft.com/en-us/library/bb232090(v=exchg.80).aspx and then just load the 2007 snapin in your .NET code which will be the best solution.

    Otherwise other then what I mentioned before there isn't really anything else bar Mapi that you can use (and mostly what's happening in Remote powershell in 2010 is its just abstracting out Mapi). If you wanted to create a lot of work for yourself what you could do is take what your doing in Mapi and then develop your own ROP client using the Exchange Protocol documents http://msdn.microsoft.com/en-us/library/cc425499(v=exchg.80).aspx.  And watch http://channel9.msdn.com/Tags/exchange+server+protocol+documents+overview+event+2010 which could allow you to remove the Mapi requirement.

    (Best Advice I'd stick with using Powershell)

    Cheers
    Glen

    Tuesday, July 3, 2012 6:56 AM
  • Thanks Glen.....
    How can I found the following reports using Exchange Web Services. That means in webservice which class can I used for the following reports?

    MailboxSize, Mailbox Items Count, Disabled mailboxes, Mailbox Folders Properties, Public Folders Size Report, Empty Public Folders

    If possible pls give me some links.


    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful"

    Tuesday, July 3, 2012 10:22 AM
  • MailboxSize, Mailbox Items Count

    With EWS you can't get these directly (eg there is no equivalent of doing a GetMailboxTable in Mapi with EWS so you can't access those top level properties which include the logon details like you would in Mapi). The only thing you can do in EWS is access the Size of each Mailbox Folder and then add them together to get the mailbox size see http://social.technet.microsoft.com/Forums/fi-FI/exchangesvrdevelopment/thread/b4a10ba2-8ae7-40e7-9408-f198a5b9ce10 . This uses the EWS Managed API which you can download from http://www.microsoft.com/en-us/download/details.aspx?id=30141. Doing this for every mailbox on a Server is going to be slow and require you to have Full Access to every mailbox.

    Disabled mailboxes - You would need to use LDAP to get these use the Bitwise Ldap filter (UserAccountControl:1.2.840.113556.1.4.803:=2)  see http://support.microsoft.com/kb/269181 then check other properties to see if its a Mailbox Enalbed account (note Meeting Room/Resource Mailboxes will be disabled by default so be carefull)

    Mailbox Folders Properties - What properties ?

    Public Folders Size Report, Empty Public Folders - With Public folders you can't do a deep traversal so you need to start at the Root public folder then do shallow traversal of every folder within the Tree(this can be quite a lengthy process) there a EWS Managed API script in http://technet.microsoft.com/en-us/library/hh547012 that demonstrates that.

    Cheers
    Glen

    • Marked as answer by P Elayaraja Wednesday, July 4, 2012 7:25 AM
    Wednesday, July 4, 2012 6:14 AM
  • Very thanks glen.. Realy your helps is useful one for me....  I have closed this thread now and if I have any doubts I will post here using new threads and I hope you will hepl to me again..

    Once again Thanks Glen...


    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful"

    Wednesday, July 4, 2012 7:24 AM