Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

VBScript: Connecting to Exchange Folders without using Outlook

Options
  • 07-11-2006 6:33pm
    #1
    Registered Users Posts: 68,317 ✭✭✭✭


    I Know this is probably a long shot.

    Long story short, I need to be able to connect to Exchange, add contacts to contact folders and disconnect again, using VBScript.

    Long story long:

    I'm writing a script to replace a bodged solution we have running at the moment. The script places queries against an MSSQL database and compiles a list of contacts for a user. It does this for 115 users (each user has their own personal set of contacts).
    Then it takes the compiled contacts of each user and loads these contacts into a particular Contacts folder on their Exchange mailbox. Before it loads the contacts, it empties the folder first.

    Currently, I have Outlook running, connected to all users' mailboxes. The script accesses the Outlook API to empty each users' contacts folder and create each new contact in that folder. Emptying the folder is fine. It deletes around 50 contacts per second. But creating them is slow. It only adds around 8-10 new contacts per second. Some users have around 600 contacts. One or two have more than 1000 :eek:. On average they have around 200. So it takes about 30 minutes to complete the import of contacts for everyone.

    I just want to know if there's a way to bypass the Outlook API and add the info directly into the Exchange mailboxes, i.e. is their an Exchange API I can use?

    Thanks


Comments

  • Registered Users Posts: 2,931 ✭✭✭Ginger


    A bit of a long shot

    But.. you could use ADSI and CDO, and possibly this http://support.microsoft.com/?kbid=172093

    DUnno if that will help you much tho..


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Cheers Ginger. I managed to locate some stuff on CDOEX and .NET. I'll need to install some exchange tools on my machine though, and I'm not sure how crazy I'd be about scheduling the script on the Exchange machine. It's also a little irritating that it's HTTP-based as opposed to ODBC or something similar.

    Worth a look though...


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,693 Mod ✭✭✭✭Capt'n Midnight


    exmerge can be setup to empty the contacts folders and a second pass to reload them from pst's , it uses the pst name to match the account

    so all you need to do is figure out how to add contacts to a pst


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Well if you use that..

    He is connected to all users mailboxes

    Just created them in the Outlook store (pst file)


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    exmerge can be setup to empty the contacts folders and a second pass to reload them from pst's , it uses the pst name to match the account

    so all you need to do is figure out how to add contacts to a pst
    It's a nice twist on it. The only way I can think to add the contacts to the pst though is using the same API as for adding the contacts to the mailboxes. Which doesn't remove the speed factor :)

    Although it might - it may be quicker to add contacts to a local PST than to a mailbox store, and then copy them to the user's contacts folder. It's worth a look definitely.

    It would also be a lot easier to troubleshoot with just one PST and hundreds of contacts folders, instead of hundreds of excel files.


  • Advertisement
  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,693 Mod ✭✭✭✭Capt'n Midnight


    seamus wrote:
    It would also be a lot easier to troubleshoot with just one PST and hundreds of contacts folders, instead of hundreds of excel files.
    if you run exmerge you can export from each mailbox, and it will create or add to a PST of the name of each mailbox, one pst per mailbox.

    If you don't mind loading down the global address list you could add in contacts there with some information like address and phone directly from CSV's using CSVDE, maybe if you changed the sort order of the GAL to per office or something and created fake "offices" based on the users name. Everyone could see all contacts but only if you drilled down.


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    if you run exmerge you can export from each mailbox, and it will create or add to a PST of the name of each mailbox, one pst per mailbox.
    The details are coming from an MSSQL server though, so exporting the contacts is of no use, unless I'm misunderstanding :)
    If you don't mind loading down the global address list you could add in contacts there with some information like address and phone directly from CSV's using CSVDE, maybe if you changed the sort order of the GAL to per office or something and created fake "offices" based on the users name. Everyone could see all contacts but only if you drilled down.
    The contacts do need to be reasonably private. They're client details, so loading them into the GAL would make them potentially accessible to over 100,000 colleagues in 144 countries. A data protection nightmare if I ever saw one :)

    In total there's only about 2000 contacts, but each has their own selection of these, which inflates the total number of distinct records to something approaching 10,000.

    Thanks for the suggestions though.

    I ran the full script in test mode yesterday, and it's far slower than the 30 minutes I projected. 2.5 hours slower. That's still 6 hours faster than our current solution though.


Advertisement