แชร์ผ่าน


Utility to create Active Directory users for CRM Bulk Mail testing

Ring Of Fire...

I've been working with a number of our new CRM partners over the last couple of months, helping them to develop their own CRM pre-sales, demonstration capabilities. One of the more common problems they face is how to simulate the round-tripping of e-mails to show product capabilities such as the Outlook client, bulk mail and e-mail via mail-merge. As John mentioned in his blog (https://blogs.msdn.com/jstraumann/archive/2006/02/15/532485.aspx), you can create Active Directory user accounts with Exchange mailboxes for your contacts on your test system, and use Outlook Web Access or Outlook Express with a POP3 profile to access the mailbox, simulating a contact receiving a mail, and sending a reply.

This is great, but what happens if you need to demonstrate sending bulk mail to a marketing list with several hundred/thousand contacts. Do you create individual Active Directory accounts for each contact (a very time consuming manual process), or do you live with the fact you will receive several hundred/thousand undeliverable mail messages from Exchange (not a great crowd-pleaser in a customer meeting).

I faced this exact problem, so I decided to write a VB.NET utility to do the following.

  1. Load a flat-file of contacts (freshly exported from CRM into Excel and saved as a .csv file), where the first column contained the First Name, the second column contained the Last Name, and the third column contained the E-Mail address.
  2. For each contact, create an Active Directory user account with a login name of DOMAIN\FirstName.LastName, a fixed password of pass@word1 and the E-Mail address, using the System.DirectoryServices namespace classes of the .NET framework.
  3. Create an Exchange mailbox for the user using the CDOEXM.dll COM object classes.
  4. Repeat until all contacts are created.

I have tested this with a flat file containing over 1,200 contact records and in a couple of minutes I have the ability to send e-mail to a large marketing list without the deluge undeliverable mail messages.

I've uploaded the Visual Studio 2003 project source code here for you to use, including my 1,200+ contact flat file and a very brief readme file to explain how to set the correct parameters for your environment such as your Active Directory domain name, Exchange server name, etc. This code is entirely unsupported by Microsoft, me or anyone else, but I am happy to answer any reasonable questions.

A couple of final points to note. Because the CDOEXM.dll file is only installed on an Exchange server, you need to run this utility on your demo Exchange server if your demo is split over multiple servers. And secondly, you need to be logged on with a user account that has Domain Admin and Exchange Admin rights.

This posting is provided "AS IS" with no warranties, and confers no rights

Create Active Directory Users.zip