Discussion:
How to Get really ALL (including orphaned) mailboxes in specified MBX Store?
(too old to reply)
tester
19 years ago
Permalink
Hello!

I would like to get All mailboxes and their urls BUT not only these
registered in AD .I am looking for All physically residing mailboxes BUT
in *specified by name* Mailbox store including "orphaned ones"?(not just
"server-all" mailboxes). Please help me how to get all physically
existing mailboxes in specified Mailbox Store.

Kind Regards,
Mike
Glen Scales [MVP]
19 years ago
Permalink
If you using Exchange 2003 then take a look at the Exchange_mailbox WMI
class this will let you list all mailboxes that are in the store
(dateDiscoveredAbsentInDS can be used to determine if you have any orphaned
mailboxes) see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_wmiref_cl_exchange_mailbox.asp .
Otherwise you need to look at writing something using Extended Mapi and
using getmailbox see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/exchserv/html/intrface_24it.asp

Cheers
Glen
Post by tester
Hello!
I would like to get All mailboxes and their urls BUT not only these
registered in AD .I am looking for All physically residing mailboxes BUT
in *specified by name* Mailbox store including "orphaned ones"?(not just
"server-all" mailboxes). Please help me how to get all physically existing
mailboxes in specified Mailbox Store.
Kind Regards,
Mike
tester
19 years ago
Permalink
Post by Glen Scales [MVP]
Otherwise you need to look at writing something using Extended Mapi and
using getmailbox see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/exchserv/html/intrface_24it.asp
Cheers
Glen
Thank You for valuable tips, but another problems hit me.
I am trying to use includes from Exchange SDK 2000 and 2003 (released on
August 2006) to get IExchangeManageStore interface for getmailbox. It is
done by edk.h in all samples. Have You seen how old are edk.h and other
header files ? It is completely unusable with Visual Studio over 6.0
becouse of using sources like #include <ctl3d.h>,libs like msvcrt.lib
and redefinitions for WCHAR inside. Does anyone from MS care about
Exchange SDK to make it compatible with 2003 and current Visual Studio
2005? This SDK looks like complete disaster for today.

Kind Regards,
Mike
Joe Richards [MVP]
19 years ago
Permalink
Yeah I have tried making this work under newer versions of Visual Studio
as well and have failed quite completely. MAPI isn't supposed to be the
preferred mechanism to access Exchange anymore I believe...

--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net


---O'Reilly Active Directory Third Edition now available---

http://www.joeware.net/win/ad3e.htm
...
Glen Scales [MVP]
19 years ago
Permalink
Generally you want to try to avoid using mapi with .NET firstly because it's
not supported and there are also a few another know issues if you do want to
try have a look at
http://blogs.msdn.com/jasonjoh/archive/2004/08/01/204585.aspx which may
help. There is also a third party .NET wrapper called mapi33 that you might
want to have a look at (never used it my self so I cant comment on how
effective it is).

Unfortunately there are number of things you can really only do using Mapi
so keeping an old version of Visual Studio around for building com objects
is usually the best approach and if you need to use the code in .NET just
call the unmanged code to do these functions.

Cheers
Glen
...
tester
19 years ago
Permalink
I don't use .NET managed code at all but I have to use VS 2003 becouse
of MFC71 I need. There is lack of <ctl3d.h> and msvcrt.lib in VS 2003. I
have to compile project using VS 2003 becouse of whole project
compatibility and that is my problem with IExchangeManageStore for
Exchange 2000...
...
tester
19 years ago
Permalink
Post by Glen Scales [MVP]
Otherwise you need to look at writing something using Extended Mapi and
using getmailbox see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/exchserv/html/intrface_24it.asp
Cheers
Glen
MAPI getmailbox - returns all mailboxes from all MBX stores.
Which MAPI attribute/property to use or how to find to which MBX store
belongs mailbox if there is more then one MBX Store?
I want to see mialboxes like in Exchange Server Manager which are
divided to stores they belong.

Regards,
Mike
Glen Scales [MVP]
19 years ago
Permalink
If your using Exchange 2003 then there is a new interface
IExchangeManageStore5 you can use to retrieve just the mailboxes or public
folders of the store you are targeting see
http://support.microsoft.com/kb/908072. Otherwise i dont think this
information is exposed by this interface you might have to open each mailbox
and check the PR_STORE_ENTRYID to work out which store a mailbox belongs to.
Im not sure how ESM gets this information.

Cheers
Glen
...
tester
19 years ago
Permalink
Post by Glen Scales [MVP]
If your using Exchange 2003 then there is a new interface
IExchangeManageStore5 you can use to retrieve just the mailboxes or public
folders of the store you are targeting see
http://support.microsoft.com/kb/908072. Otherwise i dont think this
information is exposed by this interface you might have to open each mailbox
and check the PR_STORE_ENTRYID to work out which store a mailbox belongs to.
Im not sure how ESM gets this information.
The method for checking each mailbox by opening it is not nice for
Exchange 2000.I would like to have it working on all Exchange Serves in
"smooth way". Could You escalate my query about "how ESM does it" to any
other MVP?

Kind Regards,
Mike

Joe Richards [MVP]
19 years ago
Permalink
Look for the Windows Server Cookbook, it has been a while since I looked
but I am pretty sure the chapter I wrote for it on Exchange has scripts
to do this.

--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net


---O'Reilly Active Directory Third Edition now available---

http://www.joeware.net/win/ad3e.htm
Post by tester
Hello!
I would like to get All mailboxes and their urls BUT not only these
registered in AD .I am looking for All physically residing mailboxes BUT
in *specified by name* Mailbox store including "orphaned ones"?(not just
"server-all" mailboxes). Please help me how to get all physically
existing mailboxes in specified Mailbox Store.
Kind Regards,
Mike
Loading...