Testing with Exchange Server – Tips and Tricks – Part 1 – Setting up Active Directory
Posted by Reka Burmeister in Exchange, Exchange 2007, Exchange Archiving, Exchange Testing, Software Testing, Tutorials, Uncategorized on 08-02-2010
Tags: Exchange, Exchange 2007, Exchange software testing, Exchange Testing, messages, Software Testing
Testing in an Exchange environment has been a challenge for Red Gate Software for some time now as we developed and tested Exchange Server Archiver. Now we are working on a PST Importer tool, we had to once again ‘fire up’ our virtual servers. The problem was a bit more complex this time, because if we want to create a realistic test environment we should have about a hundred virtual machines that we could hook on to our domain. As before, we’ll need mailboxes for these users but this time we would like some of the PST files to be opened in some of the users’ Outlook (I’ll explain this later). So here’s how we managed to do this all without actually creating all the machines for it.
The first step was the easiest – create around a hundred machines in different organisational units in active directory.
We needed this part as our Search wizard queries Active Directory for computers in the system. The user than can select the computers they wish to search for PST files. The grid where they are displayed and various features around selection should be tested, but at this stage it is enough if the computer is simply created in Active Directory. You can go to your Domain Controller, run “Active Directory Users and Computers” management console, right click on any container, select “New” and select “Computer”. This way you can create any computer in your AD tree without physically having it in your system. If one desires to create a larger amount of computers, doing it manually really shouldn’t be an option, in which case a simple .bat file solves the problem.
To create an OU where the new computer(s) should go:
dsadd ou "OU=[name_of_OU],DC=[name_of_domain],DC=[name_of_domain]"
For embedded OUs:
dsadd ou “OU=[name_of_OU_child2], OU=[name_of_OU_child1], OU=[name_of_OU_parent],DC=[name_of_domain],DC=[name_of_domain]”
To add the computer:
dsadd computer "cn=[computer_name],ou=[ou_name(s)],dc=[name_of_domain],dc=[name_of_domain]" -uc
And now that we have the window open anyway, to add a user:
dsadd user "CN=[user_name],OU=[name_of_ou],DC=[name_of_domain],DC=[name_of_domain]" -samid [name_of_user (SAM id)] -upn [user_name@fqdn]
-fn [First_name] -ln [last_name] -display "[display_name]" -pwd [password]
This enables us to test most of the basic grid functionality and enablement. In order to check that these non-existing machines are handled correctly when the PST agent is installed on them our developers created a “data faker”, that browses the AD tree to get all computer names and we can set all available statuses for the computers found. This data faker is used to simulate search results as well.
We usually do a script that creates these user/computer names with an incrementing counter, but in some cases it might be a collection of really nasty characters/deeply embedded OUs or other special cases.
[...] a previous article I mentioned how to create users and computers in active directory, the first stage of testing the [...]