[python-win32] getting global addressbook with extended mapi

Mark Hammond mhammond at skippinet.com.au
Tue Jun 7 00:53:11 CEST 2005


HrFindExchangeGlobalAddressList and a few others appeared to vanish from
recent Exchange SDK versions.  Its not clear from MSDN what the status is of
those functions, but they certainly don't appear in any MS .h files I
currently have.

It appears that ActiveDirectory can be used to access the GAL on later
exchanges - maybe that is the new "official" way of doing it?  A quick
google may offer other advice - eg, see if you can find any C++ code that
references the GAL by any way other than that function.

Mark

> -----Original Message-----
> From: python-win32-bounces at python.org
> [mailto:python-win32-bounces at python.org]On Behalf Of Jürgen Kareta
> Sent: Tuesday, 7 June 2005 12:50 AM
> To: python-win32 Mailinglist
> Subject: [python-win32] getting global addressbook with extended mapi
>
>
> Hello,
>
> I followed Marks hint and tried to get my global addressbook entries
> with extended mapi.
>
> from win32com.mapi import mapiutil
> from win32com.mapi import exchange
> import pprint,pythoncom
> profileName = "Test"
> session = mapi.MAPIInitialize(None)
> session =mapi.MAPILogonEx(0,'test',None, mapi.MAPI_EXTENDED |
> mapi.MAPI_LOGON_UI |\
>                              mapi.MAPI_NO_MAIL |mapi.MAPI_USE_DEFAULT)
> hr=session.OpenAddressBook(0,None,mapi.AB_NO_DIALOG)
> gal = exchange.HrFindExchangeGlobalAddressList (hr)
>
> raise:
> gal = exchange.HrFindExchangeGlobalAddressList (hr)
> NotImplementedError: Not available with this version of the
> Exchange SDK
>
> So it seems to be that our exchange5.5 SP3 Server don't provide all
> extended mapi features. But the
> DumpTopLevelFolders funktion of the class MAPIDriver in spambayes
> sandbox works fine.
>
> How can I find a workaround to access the gal entries ?
>
> The final solution should work like the following cdo code:
> from win32com.client.dynamic import Dispatch
> s=Dispatch("Mapi.session")
> s.Logon("", "", False, True, 0, True,\
>
> ProfileInfo="/o=myserver/ou=myside/cn=Configuration/cn=myserve
> r\n\nanon")
> entries=s.AddressLists('Globales Adressbuch').AddressEntries.Item(my
> distribution list).Members
> for entr in entries:
>     print
> entr.Name,entr.Fields(0x39fe001e).Value,entr.Fields(0x3a00001e)
>
>  Any hints ?
>
> regards,
> Jürgen
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32



More information about the Python-win32 mailing list