1
votes

I need to create a mailbox on an exchange 2003 server using python. The stunt conditions are that our machines have either office 2007 and office 2010 installed and thus the cdoexm.dll is not installed on the system. Also as it is 2007/10 you cant install the ExchangeCdo as it requires certain versions of outlook. Also mapi is not enabled on the server.

Is this a case where I will have to call an external program to do this? I've spent the last couple of days trawling sites but all the solutions seem to use cdoexm.

Hope someone has some ideas!

1

1 Answers

0
votes

OK so it wasn't a python problem in the end but did require CDOEXM. First you need to go to control panel->add/remove programs->add/remove windows components. Select Internet Information Services (IIS) and click details, tick Internet Information Services Snap-In and click OK, then next and install (you will need the xp sp3 cd for this).

After this is done you will need the exchange server (in my case 2003) install cd and you want to install management components only. When this is finally done you will have the CDOEXM dll which you can then use in your projects.

Heres an example using Tim Golden's awesome active directory module for Python.

import active_directory

homeMDB = "CN=UBER MAILBOX,CN=InformationStore,CN=UBERMAILSERVER,"\
        "CN=Servers,CN=Administrative Groups,CN=UBERORG,"\
        "CN=Microsoft Exchange,CN=Services,CN=Configuration,"\
        "DC=uber,DC=org,DC=uk"

user=active_directory.find_user("captain.awesomeface")
user.CreateMailbox(homeMDB)


user.Properties["mail"].Value = "[email protected]";

user.SetInfo()