<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SysAdmin Talk &#187; Software Testing</title>
	<atom:link href="http://sysadmin-talk.org/tag/software-testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://sysadmin-talk.org</link>
	<description>Practical advice from front-line SysAdmins</description>
	<lastBuildDate>Sun, 20 May 2012 14:12:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Testing with Exchange Server – Tips and Tricks – Part 2 – Creating Mailboxes</title>
		<link>http://sysadmin-talk.org/2010/06/testing-with-exchange-server-%e2%80%93-tips-and-tricks-%e2%80%93-part-2-%e2%80%93-creating-mailboxes/</link>
		<comments>http://sysadmin-talk.org/2010/06/testing-with-exchange-server-%e2%80%93-tips-and-tricks-%e2%80%93-part-2-%e2%80%93-creating-mailboxes/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 10:24:28 +0000</pubDate>
		<dc:creator>Reka Burmeister</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Exchange Testing]]></category>
		<category><![CDATA[IT Professional]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[PST Importer]]></category>
		<category><![CDATA[Software Testing]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Exchange software testing]]></category>
		<category><![CDATA[PST]]></category>
		<category><![CDATA[PST Files]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=463</guid>
		<description><![CDATA[In a previous article I mentioned how to create users and computers in active directory, the first stage of testing the PST Importer (and ESA). The next step is to go to Exchange and create mailboxes to the users that we just created and for further comfortable management, add access permissions to them where needed. [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://sysadmin-talk.org/2010/02/testing-with-exchange-server-tips-and-tricks-part-1-setting-up-active-directory/" target="_blank">previous article</a> I mentioned how to create users and computers in active directory, the first stage of testing the PST Importer (and ESA). The next step is to go to Exchange and create mailboxes to the users that we just created and for further comfortable management, add access permissions to them where needed.<span id="more-463"></span></p>
<p>This is much easier in Exchange 2007 than it was in Exchange 2003 as here we can use PowerShell. I would like to mention that in case of using Ex 2007, we don’t even have to create the users in advance, the server will take care of that for you. For the full 2007 PowerShell reference guide please see this page <a href="http://technet.microsoft.com/en-us/library/bb123703%28EXCHG.80%29.aspx#NthruR">http://technet.microsoft.com/en-us/library/bb123703%28EXCHG.80%29.aspx#NthruR</a></p>
<p>In short, in order to create a new user type in:</p>
<p><code>New-Mailbox -Name &lt;String&gt; -Database &lt;DatabaseIdParameter&gt; -Password &lt;SecureString&gt; -UserPrincipalName &lt;String&gt; [-DisplayName &lt;String&gt;] [-FirstName &lt;String&gt;] [-Initials &lt;String&gt;] [-LastName &lt;String&gt;]</code></p>
<p>You might notice that if you simply type a string in for the password you’ll get an error:</p>
<p><code>New-Mailbox : Cannot bind parameter 'Password'. Cannot convert value "[given_password]" to type "System.Security.SecureString". Error: "Invalid cast from 'System.String' to ‘System.Security.SecureString'."</code></p>
<p>The reason for this is that the given password has to be a secure string type. In order to create it, type in the following (has to be separate from the previous command):</p>
<p><code><br />
$Password = ConvertTo-SecureString '&lt;string&gt;' -AsPlainText –Force</code></p>
<p>After this you could refer to the given password as $Password.</p>
<p>We usually use this command in two different ways. The first one is to use a scripting language (my preference is Python) to generate the commands with different names. I have a list with the thousand most popular first names and the thousand most popular surnames. My script simply combines the two, giving me quite a lot of options. The second method is to name the users using a counter such as User 1; User 2;&#8230; User n and use a cycle in PowerShell to generate all required user names, such as:</p>
<p><code>$Password = ConvertTo-SecureString '&lt;password&gt;' -AsPlainText –Force</code></p>
<p><code>for ($i=0; $i -le 10; $i++)</p>
<p>{</code></p>
<p><code>New-Mailbox –Name &lt;name&gt;$i -Database &lt;dbname&gt; -Password $Password -UserPrincipalName &lt;UPname&gt; -DisplayName "&lt;name&gt; $i" -FirstName &lt;firstname&gt; -LastName $i</p>
<p>}</code></p>
<p>If someone doesn’t like PowerShell or doesn’t have it (e.g. Exchange 2003), the batch files I mentioned earlier used in active directory work just fine. After creating the users using those the mailboxes can be assigned to them fairly easily. In Exchange 2007, we have to start the “create new mailbox” process and select “existing users” in the first window. </p>
<p>This will show all users in AD that don’t have mailboxes. Fortunately multiselection is allowed so we don’t have to handle them one by one. Exchange 2003 doesn’t have this feature but there’s an easy workaround. Do a search using Exchange 2003’s Active Directory Users and Computers application for all users and multiselect them. Right clicking once will open the context menu where we can select “Exchange tasks” and “Create exchange mailbox” from there.</p>
<p>Finally, the command to add full access rights to a specific user so all mailboxes could be opened (and managed) from one outlook:</p>
<p><code>foreach ($sg in Get-StorageGroup) { if ((Get-ExchangeServer<br />
$sg.Server).Domain.Equals("<em>DomainName.com</em>")) { get-mailboxdatabase<br />
-storagegroup $sg.Identity | add-adpermission -user <em>UserName</em><br />
<em> </em>-accessrights GenericAll; } }</code></p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/06/testing-with-exchange-server-%e2%80%93-tips-and-tricks-%e2%80%93-part-2-%e2%80%93-creating-mailboxes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Testing with Exchange Server &#8211; Tips and Tricks &#8211; Part 1 &#8211; Setting up Active Directory</title>
		<link>http://sysadmin-talk.org/2010/02/testing-with-exchange-server-tips-and-tricks-part-1-setting-up-active-directory/</link>
		<comments>http://sysadmin-talk.org/2010/02/testing-with-exchange-server-tips-and-tricks-part-1-setting-up-active-directory/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 13:38:02 +0000</pubDate>
		<dc:creator>Reka Burmeister</dc:creator>
				<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange Archiving]]></category>
		<category><![CDATA[Exchange Testing]]></category>
		<category><![CDATA[Software Testing]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Exchange software testing]]></category>
		<category><![CDATA[messages]]></category>

		<guid isPermaLink="false">http://sysadmin-talk.org/?p=122</guid>
		<description><![CDATA[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 &#8216;fire up&#8217; our virtual servers. The problem was a bit more complex this time, because if [...]]]></description>
			<content:encoded><![CDATA[<p>Testing in an Exchange environment has been a challenge for <a href="http://www.red-gate.com?subject=sysadmintalk">Red Gate Software</a> for some time now as we developed and tested <a href="http://www.red-gate.com/products/Exchange/index.htm?subject=sysadmintalk">Exchange Server Archiver</a>. Now we are working on a PST Importer tool, we had to once again &#8216;fire up&#8217; 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.<span id="more-122"></span></p>
<p>The first step was the easiest – create around a hundred machines in different organisational units in active directory.</p>
<p>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.</p>
<p>To create an OU where the new computer(s) should go:</p>
<p><code>dsadd ou "OU=[name_of_OU],DC=[name_of_domain],DC=[name_of_domain]"</code></p>
<p>For embedded OUs:</p>
<p>dsadd ou &#8220;OU=[name_of_OU_child2], OU=[name_of_OU_child1], OU=[name_of_OU_parent],DC=[name_of_domain],DC=[name_of_domain]&#8221;</p>
<p>To add the computer:</p>
<p><code>dsadd computer "cn=[computer_name],ou=[ou_name(s)],dc=[name_of_domain],dc=[name_of_domain]" -uc</code></p>
<p>And now that we have the window open anyway, to add a user:</p>
<p><code>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]<br />
-fn [First_name] -ln [last_name] -display "[display_name]" -pwd [password]</code></p>
<p>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.</p>
<p>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.</p>
<p><strong>*<a href="http://sysadmin-talk.org/2010/06/testing-with-exchange-server-%E2%80%93-tips-and-tricks-%E2%80%93-part-2-%E2%80%93-creating-mailboxes/" target="_blank">Coming up in Part 2 &#8211; Reka will cover scripts to create mailboxes in Exchange 2007, and how to modify access rights on them</a>.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://sysadmin-talk.org/2010/02/testing-with-exchange-server-tips-and-tricks-part-1-setting-up-active-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

