<?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>Jonathan Medd&#039;s Blog &#187; exchange 2003</title>
	<atom:link href="http://www.jonathanmedd.net/tag/exchange-2003/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jonathanmedd.net</link>
	<description>Scripting. Powershell, VMware, Windows, Active Directory &#38; Exchange. All that kind of stuff.....</description>
	<lastBuildDate>Wed, 21 Jul 2010 12:41:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Updated Exchange 2003 PowerGUI PowerPack</title>
		<link>http://www.jonathanmedd.net/2010/02/updated-exchange-2003-powergui-powerpack.html</link>
		<comments>http://www.jonathanmedd.net/2010/02/updated-exchange-2003-powergui-powerpack.html#comments</comments>
		<pubDate>Sun, 21 Feb 2010 19:18:03 +0000</pubDate>
		<dc:creator>Jonathan Medd</dc:creator>
				<category><![CDATA[exchange 2003]]></category>
		<category><![CDATA[powergui]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://www.jonathanmedd.net/?p=853</guid>
		<description><![CDATA[Since PowerGUI version 1.8 there have been some great enhancements in PowerPack management. So I finally got round to updating the Exchange 2003 PowerPack and publishing it in the new format. One of the best new features is the ability to update the PowerPack from the application &#8211; previously you had to manually download the [...]]]></description>
			<content:encoded><![CDATA[<p>Since <a href="http://powergui.org/index.jspa" target="_blank">PowerGUI</a> version 1.8 there have been some great enhancements in PowerPack management. So I finally got round to updating the Exchange 2003 PowerPack and <a href="http://powergui.org/entry.jspa?externalID=1956&amp;categoryID=47" target="_blank">publishing it in the new format</a>. One of the best new features is the ability to update the PowerPack from the application &#8211; previously you had to manually download the new version, remove the old one then import the updated copy.</p>
<p>Within the PowerPack Management Dialogue Box you can see the current version of your PowerPack:</p>
<p><a rel="attachment wp-att-854" href="http://www.jonathanmedd.net/2010/02/updated-exchange-2003-powergui-powerpack.html/powerpackmanagement1"><img class="aligncenter size-full wp-image-854" title="PowerPackManagement1" src="http://www.jonathanmedd.net/wp-content/uploads/2010/02/PowerPackManagement1.PNG" alt="PowerPackManagement1" width="597" height="415" /></a></p>
<p>If you click on the <strong>Check for Update</strong> button PowerGUI will check for an updated version of the PowerPack whether it be on the PowerGUI website or on a locally availbale file share. If there is a new version then you are prompted to download it and upgrade:</p>
<p><a rel="attachment wp-att-855" href="http://www.jonathanmedd.net/2010/02/updated-exchange-2003-powergui-powerpack.html/powerpackmanagement2"><img class="aligncenter size-full wp-image-855" title="PowerPackManagement2" src="http://www.jonathanmedd.net/wp-content/uploads/2010/02/PowerPackManagement2.PNG" alt="PowerPackManagement2" width="479" height="172" /></a></p>
<p>Answer <strong>Yes</strong> and the updated PowerPack will begin to download:</p>
<p><a rel="attachment wp-att-856" href="http://www.jonathanmedd.net/2010/02/updated-exchange-2003-powergui-powerpack.html/powerpackmanagement3"><img class="aligncenter size-full wp-image-856" title="PowerPackManagement3" src="http://www.jonathanmedd.net/wp-content/uploads/2010/02/PowerPackManagement3.PNG" alt="PowerPackManagement3" width="345" height="109" /></a></p>
<p>Once complete you will see it has been updated to the new version:</p>
<p><a rel="attachment wp-att-857" href="http://www.jonathanmedd.net/2010/02/updated-exchange-2003-powergui-powerpack.html/powerpackmanagement4"><img class="aligncenter size-full wp-image-857" title="PowerPackManagement4" src="http://www.jonathanmedd.net/wp-content/uploads/2010/02/PowerPackManagement4.PNG" alt="PowerPackManagement4" width="592" height="416" /></a></p>
<p>By default PowerGUI will check for updated PowerPacks everytime you open it:</p>
<p><a rel="attachment wp-att-858" href="http://www.jonathanmedd.net/2010/02/updated-exchange-2003-powergui-powerpack.html/powerpackmanagement6"><img class="aligncenter size-full wp-image-858" title="PowerPackManagement6" src="http://www.jonathanmedd.net/wp-content/uploads/2010/02/PowerPackManagement6.PNG" alt="PowerPackManagement6" width="416" height="386" /></a></p>
<p>If you are a PowerPack creator then you can specify the location of your PowerPack. PowerGUI will automatically update the version number for you whenever you save any changes to it:</p>
<p><a rel="attachment wp-att-859" href="http://www.jonathanmedd.net/2010/02/updated-exchange-2003-powergui-powerpack.html/powerpackmanagement7"><img class="aligncenter size-full wp-image-859" title="PowerPackManagement7" src="http://www.jonathanmedd.net/wp-content/uploads/2010/02/PowerPackManagement7.PNG" alt="PowerPackManagement7" width="500" height="521" /></a></p>
<p>Its as simple as that!</p>
<p>As an extra bonus I have added a new script node to the PowerPack which examines the event log of an Exchange 2003 server and reports the whitespace in each database for you.</p>
<p><a rel="attachment wp-att-864" href="http://www.jonathanmedd.net/2010/02/updated-exchange-2003-powergui-powerpack.html/powerpackmanagement5-2"><img class="aligncenter size-full wp-image-864" title="PowerPackManagement5" src="http://www.jonathanmedd.net/wp-content/uploads/2010/02/PowerPackManagement51.PNG" alt="PowerPackManagement5" width="654" height="168" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmedd.net/2010/02/updated-exchange-2003-powergui-powerpack.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Exchange 2003 / WMI / PowerShell article over at http://www.simple-talk.com/</title>
		<link>http://www.jonathanmedd.net/2009/05/exchange-2003-wmi-powershell-article-over-at-httpwwwsimple-talkcom.html</link>
		<comments>http://www.jonathanmedd.net/2009/05/exchange-2003-wmi-powershell-article-over-at-httpwwwsimple-talkcom.html#comments</comments>
		<pubDate>Wed, 13 May 2009 22:06:08 +0000</pubDate>
		<dc:creator>Jonathan Medd</dc:creator>
				<category><![CDATA[exchange 2003]]></category>
		<category><![CDATA[powergui]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[wmi]]></category>

		<guid isPermaLink="false">http://www.jonathanmedd.net/?p=134</guid>
		<description><![CDATA[So I got asked to write an article for the http://www.simple-talk.com/ website, a well known online technical journal and community hub around SQL and .NET technologies. They&#8217;ve recently been branching out into Exchange as well hence they reason they were looking for some Exchange based articles.
The article I have written for them is based around [...]]]></description>
			<content:encoded><![CDATA[<p>So I got asked to write an article for the <a href="http://www.simple-talk.com/" target="_blank">http://www.simple-talk.com/</a> website, a well known online technical journal and community hub around SQL and .NET technologies. They&#8217;ve recently been branching out into Exchange as well hence they reason they were looking for some Exchange based articles.</p>
<p><a href="http://www.simple-talk.com/exchange/exchange-articles/so-you-thought-powershell-was-only-for-exchange-2007/" target="_blank">The article I have written for them</a> is based around a presentation I have made around some user groups a few times now, i.e. using PowerShell and WMI to manage Exchange 2003. I really enjoyed the process of transferring the content into a written article and hopefully I may get the opportunity to write some more so please check it out.</p>
<p>You can also take advantage of a free Sybex Best Of Exchange 2007 Server ebook by <a href="http://www.simple-talk.com/exchange/exchange-articles/free-exchange-server-ebook/" target="_blank">signing up for their Exchange newsletter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmedd.net/2009/05/exchange-2003-wmi-powershell-article-over-at-httpwwwsimple-talkcom.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Powershell to Find Free Space in Exchange 2003 databases: Updated</title>
		<link>http://www.jonathanmedd.net/2009/05/using-powershell-to-find-free-space-in-exchange-2003-databases-updated.html</link>
		<comments>http://www.jonathanmedd.net/2009/05/using-powershell-to-find-free-space-in-exchange-2003-databases-updated.html#comments</comments>
		<pubDate>Fri, 08 May 2009 12:26:15 +0000</pubDate>
		<dc:creator>Jonathan Medd</dc:creator>
				<category><![CDATA[exchange 2003]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://www.jonathanmedd.net/?p=129</guid>
		<description><![CDATA[Back in January I posted about how to find free space in Exchange 2003 databases using Powershell.  Not long after this we changed our online maintenance schedules resulting in each database not having maintenance every day. The original script was based on the assumption of maintenance happening every day and there being events in the [...]]]></description>
			<content:encoded><![CDATA[<p>Back in January I <a href="http://www.jonathanmedd.net/2009/01/using-powershell-to-find-free-space-in-exchange-2003-databases.html" target="_blank">posted</a> about how to find free space in Exchange 2003 databases using Powershell.  Not long after this we changed our online maintenance schedules resulting in each database not having maintenance every day. The original script was based on the assumption of maintenance happening every day and there being events in the application log for every database in the last 24 hours.</p>
<p>Consequently I have had to adjust the script so that it would look back a few days to ensure there are logs for each database. This then created an interesting problem because it meant that sometimes you would get back more than one result per database and so obviously you would only want to keep the most recent result.</p>
<p>For example you would get results like the below:</p>
<p>ServerName,MailboxStore,&#8221;Free Space (MB)&#8221;,&#8221;Time  Written&#8221;<br />
SERVER1,SG1-MAILBOX1,1592,20090423070001.000000+060<br />
SERVER1,SG1-MAILBOX1,1684,20090422070001.000000+060<br />
SERVER1,SG1-MAILBOX2,52,20090423070000.000000+060<br />
SERVER1,SG1-MAILBOX2,64,20090422070000.000000+060<br />
SERVER1,SG1-MAILBOX3,2607,20090422070001.000000+060<br />
SERVER1,SG1-MAILBOX3,2566,20090423070000.000000+060</p>
<p>If I used:</p>
<p>$myCol | Sort-Object Servername,MailboxStore -unique</p>
<p>it would produce results with only one entry per mailbox store, but it would always choose the most recent result. So I posted my issue to the PowerShell newsgroup and MVP Marco Shaw very kindly helped me work through it. The end result was this:</p>
<pre><span style="color: #800080;">$hash</span><span style="color: #000000;">=@{}
</span><span style="color: #800080;">$myCol</span><span style="color: #000000;"> | </span><span style="color: #5F9EA0; font-weight: bold;">Sort-Object</span><span style="color: #000000;"> @{Expression</span><span style="color: #FF0000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">Servername</span><span style="color: #800000;">"</span><span style="color: #000000;">;Descending</span><span style="color: #FF0000;">=</span><span style="color: #0000FF;">$false</span><span style="color: #000000;">},@{Expression</span><span style="color: #FF0000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">MailboxStore</span><span style="color: #800000;">"</span><span style="color: #000000;">;Descending</span><span style="color: #FF0000;">=</span><span style="color: #0000FF;">$false</span><span style="color: #000000;">},@{Expression</span><span style="color: #FF0000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">Time Written</span><span style="color: #800000;">"</span><span style="color: #000000;">;Descending</span><span style="color: #FF0000;">=</span><span style="color: #0000FF;">$true</span><span style="color: #000000;">} | </span><span style="color: #5F9EA0; font-weight: bold;">Foreach-Object</span><span style="color: #000000;"> {</span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$hash</span><span style="color: #000000;">[</span><span style="color: #000080;">$_</span><span style="color: #000000;">.mailboxstore] </span><span style="color: #FF0000;">-eq</span><span style="color: #000000;"> </span><span style="color: #800080;">$null</span><span style="color: #000000;">){</span><span style="color: #800080;">$hash</span><span style="color: #000000;">[</span><span style="color: #000080;">$_</span><span style="color: #000000;">.mailboxstore]</span><span style="color: #FF0000;">=</span><span style="color: #000080;">$_</span><span style="color: #000000;">}}
</span><span style="color: #800080;">$hash</span><span style="color: #000000;">.values</span></pre>
<div>Marco explains below how this works:</div>
<div><span style="color: #0000ff;">&#8220;Imagine the following simple data:</span></div>
<div><span style="color: #0000ff;"> </span></div>
<div><span style="color: #0000ff;">PS C:\Users\Marco&gt; gc  data.csv<br />
server,ip<br />
server1,ip1<br />
server1,ip2<br />
server2,ip2<br />
server2,ip3</span></div>
<div><span style="color: #0000ff;"> </span></div>
<div><span style="color: #0000ff;">In your case, you have event log entries.  Now, with the above code, you  determine you want to only retrieve the first IP listed for each server.   There&#8217;s several ways to accomplish this, but with my hash table  approach&#8230;</span></div>
<div><span style="color: #0000ff;"><br />
</span></div>
<div><span style="color: #0000ff;"> </span></div>
<div><span style="color: #0000ff;">ipcsv data.csv|%{if($hash[$_.server] -eq $null){$hash[$_.server]=$_}}</span></div>
<div><span style="color: #0000ff;"><br />
</span></div>
<div><span style="color: #0000ff;"> </span></div>
<div><span style="color: #0000ff;">So, I create $hash as a hashtable variable.</span></div>
<div><span style="color: #0000ff;"><br />
</span></div>
<div><span style="color: #0000ff;"> </span></div>
<div><span style="color: #0000ff;">I use a foreach-object to look at each object in the collection.  Looking  at each object&#8217;s server property, I get the current value of the property  ($_.server).  I use that as the key for my name/value pair in the  hashtable.</span></div>
<div><span style="color: #0000ff;"> </span></div>
<div><span style="color: #0000ff;">Basically, if we take the first line of the input data where  $_.server=&#8221;server1&#8243;, I take that property, and check if the hashtable already  has this name if($hash[$_.server] -eq $null).  If that is true, this is the  first occurence of the value &#8220;server1&#8243;, so I create that hash key with that name  and pass $_ as the value.</span></div>
<div><span style="color: #0000ff;"> </span></div>
<div><span style="color: #0000ff;">When I hit line #2 in the input data, and check $hash[$_.server] again (or  $hash["server1"]), I see that name already exists, so I skip it.</span></div>
<div><span style="color: #0000ff;"> </span></div>
<div><span style="color: #0000ff;">Then onto line #3, where $_.server is now &#8220;server2&#8243;.</span></div>
<div><span style="color: #0000ff;"> </span></div>
<div><span style="color: #0000ff;">So from the above, I make sure that for each serverX, I get only the first  IP address in the list.</span></div>
<div><span style="color: #0000ff;"><br />
</span></div>
<div><span style="color: #0000ff;"> </span></div>
<div><span style="color: #0000ff;">This is similar to your scenario where you only want the first occurence  per mailboxstore.&#8221;</span></div>
<div><span style="color: #0000ff;"><span style="color: #000000;">Nice!</span></span></div>
<div><span style="color: #0000ff;"><span style="color: #000000;">The resulting updated script is below. Note I also updated it somewhat on the original based on a useful technique illustrated in another <a href="http://www.jonathanmedd.net/2009/02/the-noble-array.html" target="_blank">posting</a>.</span></span></div>
<pre><span style="color: #800080;">$ExchServer</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">'</span><span style="color: #800000;">Server1','Server2'</span><span style="color: #000000;">

</span><span style="color: #008000;">#</span><span style="color: #008000;">Get the time 3 days ago in the right format for WMI query</span><span style="color: #008000;">
</span><span style="color: #800080;">$WmidtQueryDT</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> [</span><span style="color: #008080;">System.Management.ManagementDateTimeConverter</span><span style="color: #000000;">]::</span><span style="color: #8B4513;">ToDmtfDateTime</span><span style="color: #000000;">([</span><span style="color: #008080;">DateTime</span><span style="color: #000000;">]::</span><span style="color: #8B4513;">Now</span><span style="color: #000000;">.</span><span style="color: #8B4513;">AddDays</span><span style="color: #000000;">(</span><span style="color: #FF0000;">-</span><span style="color: #000000;">3</span><span style="color: #000000;">))

</span><span style="color: #800080;">$myCol</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> @()
</span><span style="color: #0000FF;">foreach</span><span style="color: #000000;"> (</span><span style="color: #800080;">$Server</span><span style="color: #000000;"> </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> </span><span style="color: #800080;">$ExchServer</span><span style="color: #000000;">){

    </span><span style="color: #008000;">#</span><span style="color: #008000;">Perform WMI query of Event 1221 in Application log in the last day</span><span style="color: #008000;">
</span><span style="color: #000000;">    </span><span style="color: #800080;">$eventid</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #5F9EA0; font-weight: bold;">Get-WmiObject</span><span style="color: #000000;"> -computer </span><span style="color: #800080;">$Server</span><span style="color: #000000;"> </span><span style="color: #5F9EA0; font-style: italic;">-query</span><span style="color: #000000;"> (</span><span style="color: #800000;">"</span><span style="color: #800000;">Select * from Win32_NTLogEvent Where Logfile='Application' and Eventcode = '1221' and TimeWritten &gt;='</span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #FF0000;">+</span><span style="color: #000000;"> </span><span style="color: #800080;">$WmidtQueryDT</span><span style="color: #000000;"> </span><span style="color: #FF0000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">"</span><span style="color: #800000;">'</span><span style="color: #800000;">"</span><span style="color: #000000;">)

    </span><span style="color: #0000FF;">foreach</span><span style="color: #000000;"> (</span><span style="color: #800080;">$event</span><span style="color: #000000;"> </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> </span><span style="color: #800080;">$eventid</span><span style="color: #000000;">){

        </span><span style="color: #008000;">#</span><span style="color: #008000;">Get the name of the Mailbox Store</span><span style="color: #008000;">
</span><span style="color: #000000;">        </span><span style="color: #800080;">$MBXStoreLocationStart</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$event</span><span style="color: #000000;">.Message.IndexOf(</span><span style="color: #800000;">"</span><span style="color: #800000;">Storage Group</span><span style="color: #800000;">"</span><span style="color: #000000;">) </span><span style="color: #FF0000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">16</span><span style="color: #000000;">
        </span><span style="color: #800080;">$MBXStoreLocationFinish</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$event</span><span style="color: #000000;">.Message.IndexOf(</span><span style="color: #800000;">"</span><span style="color: #800000;">has</span><span style="color: #800000;">"</span><span style="color: #000000;">) </span><span style="color: #FF0000;">-</span><span style="color: #000000;"> </span><span style="color: #000000;">2</span><span style="color: #000000;">
        </span><span style="color: #800080;">$MBXStoreLocation</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$event</span><span style="color: #000000;">.Message.SubString(</span><span style="color: #800080;">$MBXStoreLocationStart</span><span style="color: #000000;">, </span><span style="color: #800080;">$MBXStoreLocationFinish</span><span style="color: #000000;"> </span><span style="color: #FF0000;">-</span><span style="color: #000000;"> </span><span style="color: #800080;">$MBXStoreLocationStart</span><span style="color: #000000;">)

        </span><span style="color: #008000;">#</span><span style="color: #008000;">Get the free space figure</span><span style="color: #008000;">
</span><span style="color: #000000;">        </span><span style="color: #800080;">$MBLocationStart</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$event</span><span style="color: #000000;">.Message.IndexOf(</span><span style="color: #800000;">"</span><span style="color: #800000;">has</span><span style="color: #800000;">"</span><span style="color: #000000;">) </span><span style="color: #FF0000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">4</span><span style="color: #000000;">
        </span><span style="color: #800080;">$MBLocationFinish</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$event</span><span style="color: #000000;">.Message.IndexOf(</span><span style="color: #800000;">"</span><span style="color: #800000;">megabytes</span><span style="color: #800000;">"</span><span style="color: #000000;">) </span><span style="color: #FF0000;">-</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;">
        </span><span style="color: #800080;">$MBLocation</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$event</span><span style="color: #000000;">.Message.SubString(</span><span style="color: #800080;">$MBLocationStart</span><span style="color: #000000;">, </span><span style="color: #800080;">$MBLocationFinish</span><span style="color: #000000;"> </span><span style="color: #FF0000;">-</span><span style="color: #000000;"> </span><span style="color: #800080;">$MBLocationStart</span><span style="color: #000000;">)

        </span><span style="color: #008000;">#</span><span style="color: #008000;">Store the data in $myCol</span><span style="color: #008000;">
</span><span style="color: #000000;">        </span><span style="color: #800080;">$MYInfo</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">“”</span><span style="color: #000000;"> | </span><span style="color: #5F9EA0; font-weight: bold;">select-Object</span><span style="color: #000000;"> </span><span style="color: #800000;">ServerName</span><span style="color: #000000;">,</span><span style="color: #800000;">MailboxStore</span><span style="color: #000000;">,</span><span style="color: #800000;">'</span><span style="color: #800000;">Free Space (MB)</span><span style="color: #800000;">'</span><span style="color: #000000;">,</span><span style="color: #800000;">'</span><span style="color: #800000;">Time Written</span><span style="color: #800000;">'</span><span style="color: #000000;">
        </span><span style="color: #800080;">$MYInfo</span><span style="color: #000000;">.ServerName </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$event</span><span style="color: #000000;">.ComputerName
        </span><span style="color: #800080;">$MYInfo</span><span style="color: #000000;">.MailboxStore </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$MBXStoreLocation</span><span style="color: #000000;">
        </span><span style="color: #800080;">$MYInfo</span><span style="color: #000000;">.</span><span style="color: #800000;">'</span><span style="color: #800000;">Free Space (MB)</span><span style="color: #800000;">'</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$MBLocation</span><span style="color: #000000;">
        </span><span style="color: #800080;">$MYInfo</span><span style="color: #000000;">.</span><span style="color: #800000;">'</span><span style="color: #800000;">Time Written</span><span style="color: #800000;">'</span><span style="color: #000000;"> </span><span style="color: #FF0000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">$event</span><span style="color: #000000;">.TimeWritten
        </span><span style="color: #800080;">$myCol</span><span style="color: #000000;"> </span><span style="color: #FF0000;">+=</span><span style="color: #000000;"> </span><span style="color: #800080;">$MYInfo</span><span style="color: #000000;">

    }
}

</span><span style="color: #800080;">$hash</span><span style="color: #000000;">=@{}
</span><span style="color: #800080;">$myCol</span><span style="color: #000000;"> | </span><span style="color: #5F9EA0; font-weight: bold;">Sort-Object</span><span style="color: #000000;"> @{Expression</span><span style="color: #FF0000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">Servername</span><span style="color: #800000;">"</span><span style="color: #000000;">;Descending</span><span style="color: #FF0000;">=</span><span style="color: #0000FF;">$false</span><span style="color: #000000;">},@{Expression</span><span style="color: #FF0000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">MailboxStore</span><span style="color: #800000;">"</span><span style="color: #000000;">;Descending</span><span style="color: #FF0000;">=</span><span style="color: #0000FF;">$false</span><span style="color: #000000;">},@{Expression</span><span style="color: #FF0000;">=</span><span style="color: #800000;">"</span><span style="color: #800000;">Time Written</span><span style="color: #800000;">"</span><span style="color: #000000;">;Descending</span><span style="color: #FF0000;">=</span><span style="color: #0000FF;">$true</span><span style="color: #000000;">} |</span><span style="color: #5F9EA0; font-weight: bold;">Foreach-Object</span><span style="color: #000000;"> {</span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #800080;">$hash</span><span style="color: #000000;">[</span><span style="color: #000080;">$_</span><span style="color: #000000;">.mailboxstore] </span><span style="color: #FF0000;">-eq</span><span style="color: #000000;"> </span><span style="color: #800080;">$null</span><span style="color: #000000;">){</span><span style="color: #800080;">$hash</span><span style="color: #000000;">[</span><span style="color: #000080;">$_</span><span style="color: #000000;">.mailboxstore]</span><span style="color: #FF0000;">=</span><span style="color: #000080;">$_</span><span style="color: #000000;">}}
</span><span style="color: #800080;">$hash</span><span style="color: #000000;">.values | </span><span style="color: #5F9EA0; font-weight: bold;">Sort-Object</span><span style="color: #000000;"> </span><span style="color: #800000;">Servername</span><span style="color: #000000;">,</span><span style="color: #800000;">MailboxStore</span><span style="color: #000000;"> | </span><span style="color: #5F9EA0; font-weight: bold;">Export-Csv</span><span style="color: #000000;"> </span><span style="color: #800000;">AllExchangeWhiteSpace.csv</span><span style="color: #000000;"> </span><span style="color: #5F9EA0; font-style: italic;">-NoTypeInformation</span></pre>
<div><span style="color: #0000ff;"><span style="color: #000000;"><br />
</span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmedd.net/2009/05/using-powershell-to-find-free-space-in-exchange-2003-databases-updated.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Slides from MMMUG presentation</title>
		<link>http://www.jonathanmedd.net/2009/02/slides-from-mmmug-presentation.html</link>
		<comments>http://www.jonathanmedd.net/2009/02/slides-from-mmmug-presentation.html#comments</comments>
		<pubDate>Sat, 21 Feb 2009 12:34:00 +0000</pubDate>
		<dc:creator>Jonathan Medd</dc:creator>
				<category><![CDATA[exchange 2003]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[user group]]></category>
		<category><![CDATA[wmi]]></category>

		<guid isPermaLink="false">http://jonathanmedd.wordpress.com/2009/02/21/slides-from-mmmug-presentation/</guid>
		<description><![CDATA[As promised to those who attended the MMMUG on Wednesday night my slides from that evening are available on my SkyDrive.
Enjoy.
]]></description>
			<content:encoded><![CDATA[<p>As promised to those who attended the <a href="http://www.mmmug.co.uk/">MMMUG</a> on Wednesday night my slides from that evening are available on my <a href="http://cid-bad8363d570d175b.skydrive.live.com/browse.aspx/.Public">SkyDrive</a>.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmedd.net/2009/02/slides-from-mmmug-presentation.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Powershell to Find Free Space in Exchange 2003 databases</title>
		<link>http://www.jonathanmedd.net/2009/01/using-powershell-to-find-free-space-in-exchange-2003-databases.html</link>
		<comments>http://www.jonathanmedd.net/2009/01/using-powershell-to-find-free-space-in-exchange-2003-databases.html#comments</comments>
		<pubDate>Wed, 28 Jan 2009 22:25:00 +0000</pubDate>
		<dc:creator>Jonathan Medd</dc:creator>
				<category><![CDATA[exchange 2003]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://jonathanmedd.wordpress.com/2009/01/28/using-powershell-to-find-free-space-in-exchange-2003-databases/</guid>
		<description><![CDATA[One regular task for Exchange admins can be reclaiming free space within Exchange mailbox stores either after a large amount of data has been removed or just a significant amount has built up over time for various reasons. For those of you who don&#8217;t know, to reclaim the space the mailbox store has to be [...]]]></description>
			<content:encoded><![CDATA[<p>One regular task for Exchange admins can be reclaiming free space within Exchange mailbox stores either after a large amount of data has been removed or just a significant amount has built up over time for various reasons. For those of you who don&#8217;t know, to reclaim the space the mailbox store has to be taken offline and the database defragged to get the space back on the disk.</p>
<p>Finding good candidates for defragging especially in a large environment with multiple databases and Exchange servers can be a pretty tedious task. Exchange records an entry in the Application Event Log (Event ID 1221) after online maintenance has taken place which tells you how much free space is in the database &#8211; this means trawling through the event logs on each server and recording which databases you think are worth defragging. So naturally I wrote a Powershell script to save wasting time on this task!</p>
<p>Using WMI the script queries the Application log on each of the Exchange servers you choose, looking for 1221 events in the last day. It sucks out the name of the mailbox store and the amount of free space in the database from the message field of the event and if the free space is greater than a particular figure (in the example below 3GB) adds the info to a csv file.</p>
<p>You could obviously change the figure to meet your needs and also if you remove the if statement you could get it to report on every database so you have a report of free space across all databases.</p>
<p>Tip: If you have clustered mailbox servers then you only need to point the script at one of the servers in the cluster since it will contain all of the event log entries for each server in the cluster.</p>
<p><span style="color:#008000;">#</span><span style="color:#008000;">Check to see if csv exists and if so remove it</span><span style="color:#008000;"><br />
</span><span style="color:#0000ff;">If</span><span style="color:#000000;"> (</span><span style="color:#5f9ea0;font-weight:bold;">Test-Path</span><span style="color:#000000;"> </span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">FreeSpaceGreaterThan1GB.csv</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;">)<br />
{<br />
</span><span style="color:#5f9ea0;font-weight:bold;">Remove-Item</span><span style="color:#000000;"> </span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">FreeSpaceGreaterThan1GB.csv</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;"><br />
}<br />
</span><span style="color:#0000ff;">Else</span><span style="color:#000000;"><br />
{<br />
}</span></p>
<p><span style="color:#008000;">#</span><span style="color:#008000;">Set the columns for the csv file</span><span style="color:#008000;"><br />
</span><span style="color:#800080;">$rows</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">Servername,</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">+</span><span style="color:#000000;"> </span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">Mailbox Store,</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">+</span><span style="color:#000000;"> </span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">Free Space (MB),</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;"><br />
</span><span style="color:#5f9ea0;font-weight:bold;">Add-Content</span><span style="color:#000000;"> </span><span style="color:#800000;">FreeSpaceGreaterThan1GB.csv</span><span style="color:#000000;"> </span><span style="color:#800080;">$rows</span></p>
<p><span style="color:#800080;">$ExchServer</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800000;">&#8216;</span><span style="color:#800000;">server1</span><span style="color:#800000;">&#8216;</span><span style="color:#000000;">,</span><span style="color:#800000;">&#8216;</span><span style="color:#800000;">server2</span><span style="color:#800000;">&#8216;</span><span style="color:#000000;"><br />
</span><span style="color:#0000ff;">foreach</span><span style="color:#000000;"> (</span><span style="color:#800080;">$Server</span><span style="color:#000000;"> </span><span style="color:#0000ff;">in</span><span style="color:#000000;"> </span><span style="color:#800080;">$ExchServer</span><span style="color:#000000;">){</span></p>
<p><span style="color:#008000;">#</span><span style="color:#008000;">Get the time 1 day ago in the right format for WMI query</span><span style="color:#008000;"><br />
</span><span style="color:#000000;"> </span><span style="color:#800080;">$WmidtQueryDT</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> [</span><span style="color:#008080;">System.Management.ManagementDateTimeConverter</span><span style="color:#000000;">]::</span><span style="color:#8b4513;">ToDmtfDateTime</span><span style="color:#000000;">([</span><span style="color:#008080;">DateTime</span><span style="color:#000000;">]::</span><span style="color:#8b4513;">Now</span><span style="color:#000000;">.</span><span style="color:#8b4513;">AddDays</span><span style="color:#000000;">(-</span><span style="color:#000000;">1</span><span style="color:#000000;">))<br />
</span><span style="color:#008000;">#</span><span style="color:#008000;">Perform WMI query of Event 1221 in Application log in the last day</span><span style="color:#008000;"><br />
</span><span style="color:#000000;"> </span><span style="color:#800080;">$1221</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-weight:bold;">Get-WmiObject</span><span style="color:#000000;"> -computer </span><span style="color:#800080;">$ExchServer</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-style:italic;">-query</span><span style="color:#000000;"> (</span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">Select * from Win32_NTLogEvent Where Logfile=&#8217;Application&#8217; and Eventcode = &#8216;1221&#8242; and TimeWritten &gt;=&#8217;</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">+</span><span style="color:#000000;"> </span><span style="color:#800080;">$WmidtQueryDT</span><span style="color:#000000;"> </span><span style="color:#ff0000;">+</span><span style="color:#000000;"> </span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">&#8216;</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;">)</span></p>
<p><span style="color:#0000ff;">foreach</span><span style="color:#000000;"> (</span><span style="color:#800080;">$event</span><span style="color:#000000;"> </span><span style="color:#0000ff;">in</span><span style="color:#000000;"> </span><span style="color:#800080;">$1221</span><span style="color:#000000;">){</span></p>
<p><span style="color:#008000;">#</span><span style="color:#008000;">Get the name of the Mailbox Store</span><span style="color:#008000;"><br />
</span><span style="color:#000000;"> </span><span style="color:#800080;">$MBXStoreLocationStart</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span>&lt;<br />
span style=&#8221;color:rgb(0,0,0);&#8221;&gt; <span style="color:#800080;">$event</span><span style="color:#000000;">.Message.IndexOf(</span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">Storage Group</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;">) </span><span style="color:#ff0000;">+</span><span style="color:#000000;"> </span><span style="color:#000000;">16</span><span style="color:#000000;"><br />
</span><span style="color:#800080;">$MBXStoreLocationFinish</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$event</span><span style="color:#000000;">.Message.IndexOf(</span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">has</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;">) </span><span style="color:#ff0000;">-</span><span style="color:#000000;"> </span><span style="color:#000000;">2</span><span style="color:#000000;"><br />
</span><span style="color:#800080;">$MBXStoreLocation</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$event</span><span style="color:#000000;">.Message.SubString(</span><span style="color:#800080;">$MBXStoreLocationStart</span><span style="color:#000000;">, </span><span style="color:#800080;">$MBXStoreLocationFinish</span><span style="color:#000000;"> </span><span style="color:#ff0000;">-</span><span style="color:#000000;"> </span><span style="color:#800080;">$MBXStoreLocationStart</span><span style="color:#000000;">)</span></p>
<p><span style="color:#008000;">#</span><span style="color:#008000;">Get the free space figure and convert it to an integer</span><span style="color:#008000;"><br />
</span><span style="color:#000000;"> </span><span style="color:#800080;">$MBLocationStart</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$event</span><span style="color:#000000;">.Message.IndexOf(</span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">has</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;">) </span><span style="color:#ff0000;">+</span><span style="color:#000000;"> </span><span style="color:#000000;">4</span><span style="color:#000000;"><br />
</span><span style="color:#800080;">$MBLocationFinish</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$event</span><span style="color:#000000;">.Message.IndexOf(</span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">megabytes</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;">) </span><span style="color:#ff0000;">-</span><span style="color:#000000;"> </span><span style="color:#000000;">1</span><span style="color:#000000;"><br />
</span><span style="color:#800080;">$MBLocation</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$event</span><span style="color:#000000;">.Message.SubString(</span><span style="color:#800080;">$MBLocationStart</span><span style="color:#000000;">, </span><span style="color:#800080;">$MBLocationFinish</span><span style="color:#000000;"> </span><span style="color:#ff0000;">-</span><span style="color:#000000;"> </span><span style="color:#800080;">$MBLocationStart</span><span style="color:#000000;">)<br />
</span><span style="color:#800080;">$result</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> [</span><span style="color:#008080;">int</span><span style="color:#000000;">]</span><span style="color:#800080;">$MBLocation</span></p>
<p><span style="color:#800080;">$ComputerName</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$event</span><span style="color:#000000;">.ComputerName</span></p>
<p><span style="color:#008000;">#</span><span style="color:#008000;">If free space &gt; 3GB, add the details to the csv file</span><span style="color:#008000;"><br />
</span><span style="color:#000000;"> </span><span style="color:#0000ff;">if</span><span style="color:#000000;"> (</span><span style="color:#800080;">$result</span><span style="color:#000000;"> </span><span style="color:#ff0000;">-ge</span><span style="color:#000000;"> </span><span style="color:#000000;">3072</span><span style="color:#000000;">){</span></p>
<p><span style="color:#800080;">$rowline</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">$ComputerName,</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">+</span><span style="color:#000000;"> </span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">$MBXStoreLocation,</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;"> </span><span style="color:#ff0000;">+</span><span style="color:#000000;"> </span><span style="color:#800000;">&#8220;</span><span style="color:#800000;">$MBLocation,</span><span style="color:#800000;">&#8220;</span><span style="color:#000000;"><br />
</span><span style="color:#5f9ea0;font-weight:bold;">Add-Content</span><span style="color:#000000;"> </span><span style="color:#800000;">FreeSpaceGreaterThan1GB.csv</span><span style="color:#000000;"> </span><span style="color:#800080;">$rowline</span><span style="color:#000000;"><br />
}<br />
</span><span style="color:#0000ff;">else</span><span style="color:#000000;"><br />
{<br />
}</span></p>
<p>}<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmedd.net/2009/01/using-powershell-to-find-free-space-in-exchange-2003-databases.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presenting at MM&amp;M User Group UK &#8211; Wednesday 18th February</title>
		<link>http://www.jonathanmedd.net/2009/01/presenting-at-mmm-user-group-uk-wednesday-18th-february.html</link>
		<comments>http://www.jonathanmedd.net/2009/01/presenting-at-mmm-user-group-uk-wednesday-18th-february.html#comments</comments>
		<pubDate>Sun, 25 Jan 2009 21:28:00 +0000</pubDate>
		<dc:creator>Jonathan Medd</dc:creator>
				<category><![CDATA[exchange 2003]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[user group]]></category>

		<guid isPermaLink="false">http://jonathanmedd.wordpress.com/2009/01/25/presenting-at-mmm-user-group-uk-wednesday-18th-february/</guid>
		<description><![CDATA[So I was lucky enough to receive an invite from Nathan Winters who runs the MM&#38;M User Group UK (aka Exchange) to present at their next meeting on Wednesday 18th February at Microsoft in London.
It will be an evening around using Powershell to manage Exchange, the agenda is as below:
18:15 &#8211; 18:40    [...]]]></description>
			<content:encoded><![CDATA[<p>So I was lucky enough to receive an invite from Nathan Winters who runs the MM&amp;M User Group UK (aka Exchange) to present at their next meeting on Wednesday 18th February at Microsoft in London.</p>
<p>It will be an evening around using Powershell to manage Exchange, the agenda is as below:</p>
<p class="MsoNormal"><span>18:15 &#8211; 18:40            Arrival</span></p>
<p class="MsoNormal"><span>18:40 &#8211; 18:45            Introduction to speakers and the aims of the group</span></p>
<p class="MsoNormal"><span>18:45 &#8211; 19:30            1st session; Jonathan Medd, Introduction to PowerShell and Using PowerShell to manage Exchange 2003!</span></p>
<p class="MsoNormal"><span>19:30 &#8211; 19:50            Food!</span></p>
<p class="MsoNormal"><span>19:50 &#8211; 20:45            2<sup>nd</sup> session; Will Rawlings, Causing no harm with PowerShell, and using PowerShell on a large Exchange environment</span></p>
<p class="MsoNormal"><span>20:45 &#8211; 21:00            Summing up and suggestions for future meetings.</span></p>
<p><span>21:00                        The End!</span></p>
<p>If you want to attend you can sign up here <a href="http://www.mmmug.co.uk/forums/thread/26352.aspx">http://www.mmmug.co.uk/forums/thread/26352.aspx </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmedd.net/2009/01/presenting-at-mmm-user-group-uk-wednesday-18th-february.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modifying AD accounts with Powershell after an Exchange 2003 dial-tone restore</title>
		<link>http://www.jonathanmedd.net/2009/01/modifying-ad-accounts-with-powershell-after-an-exchange-2003-dial-tone-restore.html</link>
		<comments>http://www.jonathanmedd.net/2009/01/modifying-ad-accounts-with-powershell-after-an-exchange-2003-dial-tone-restore.html#comments</comments>
		<pubDate>Sun, 11 Jan 2009 16:37:00 +0000</pubDate>
		<dc:creator>Jonathan Medd</dc:creator>
				<category><![CDATA[active directory]]></category>
		<category><![CDATA[exchange 2003]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://jonathanmedd.wordpress.com/2009/01/11/modifying-ad-accounts-with-powershell-after-an-exchange-2003-dial-tone-restore/</guid>
		<description><![CDATA[Recently I&#8217;ve been testing out some different disaster recovery scenarios for Exchange 2003, one of which involved a dial-tone method &#8211; i.e. create some new mailbox servers with blank databases to get users up and running quickly and then merge the restored data back in later. One of the types of dial tone method we [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:arial;">Recently I&#8217;ve been testing out some different disaster recovery scenarios for Exchange 2003, one of which involved a </span><a href="http://www.msexchange.org/tutorials/Exchange-Dial-tone-Restore-Method-Part1.html">dial-tone method</a><span style="font-family:arial;"> &#8211; i.e. create some new mailbox servers with blank databases to get users up and running quickly and then merge the restored data back in later. One of the types of dial tone method we used was to create new server names rather than re-use existing Exchange server names.</span></p>
<p>So for example to re-create a four node (3 active, 1 passive) cluster with new names, instead of</p>
<p>ExchangeServer1<br />
<span style="font-family:arial;">Exchange</span><span style="font-family:arial;">Server2<br />
</span><span style="font-family:arial;">Exchange</span><span style="font-family:arial;">Server3</span></p>
<p>you would now use something like</p>
<p><span style="font-family:arial;">ExchangeServer1New<br />
</span><span style="font-family:arial;">ExchangeServer2New<br />
</span><span style="font-family:arial;">ExchangeServer3New</span></p>
<p>Then you would need to amend the AD user accounts for users on those Exchange Servers to point to the new locations &#8211; the following properties need to be changed.</p>
<p>homemdb<br />
msexchhomeservername<br />
homemta</p>
<p>None of these properties can be changed through ADUC, you would need to use ADSIEdit if you wanted to use a GUI. Of course those smart people among you would choose to user Powershell anyway.</p>
<p>So naturally I turned to my trusty friend the <a href="http://www.quest.com/activeroles-server/arms.aspx">Quest AD cmdlets</a> to help me out.</p>
<p>First of all we get all the users who have a mailbox based on one of the original servers; depending on your naming convention you may need to adjust this filter to make sure you are matching the correct people. The three properties mentioned are not returned by default from Get-QADUser so we have to specify them.</p>
<p>We then loop through each user and using the Switch statement if we match ExchangeServer1, 2 or 3 we amend the text of each variable to be the new Exchange servername (note: homemta will be the same for all of these users) and then user the Set-QADUser cmdlet to change these properties on the account.</p>
<pre><span style="color:#800080;">$users</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-weight:bold;">Get-QADUser</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-style:italic;">-ldapFilter</span><span style="color:#000000;"> </span><span style="color:#800000;">'</span><span style="color:#800000;">(msExchHomeServerName=*ExchangeServer*)</span><span style="color:#800000;">'</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-style:italic;">-IncludedProperties</span><span style="color:#000000;"> </span><span style="color:#800000;">homemdb</span><span style="color:#000000;">,</span><span style="color:#800000;">msexchhomeservername</span><span style="color:#000000;">,</span><span style="color:#800000;">homemta</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-style:italic;">-sizelimit</span><span style="color:#000000;"> </span><span style="color:#000000;">0</span><span style="color:#000000;">

</span><span style="color:#0000ff;">foreach</span><span style="color:#000000;">(</span><span style="color:#800080;">$user</span><span style="color:#000000;"> </span><span style="color:#0000ff;">in</span><span style="color:#000000;"> </span><span style="color:#800080;">$users</span><span style="color:#000000;">){

</span><span style="color:#800080;">$homemdb</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$user</span><span style="color:#000000;">.homemdb</span><span style="color:#800080;">$msexchhomeservername</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$user</span><span style="color:#000000;">.msexchhomeservername</span><span style="color:#800080;">$newhomemta</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800000;">'</span><span style="color:#800000;">CN=Microsoft MTA,CN=ExchangeServer1New,CN=Servers,CN=Exchange,CN=Administrative Groups,CN=Springfield,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=springfield,DC=local</span><span style="color:#800000;">'</span><span style="color:#000000;">

</span><span style="color:#0000ff;">switch</span><span style="color:#000000;"> -wildcard (</span><span style="color:#800080;">$homemdb</span><span style="color:#000000;">)

{</span><span style="color:#800000;">"</span><span style="color:#800000;">*ExchangeServer1*</span><span style="color:#800000;">"</span><span style="color:#000000;"> {</span><span style="color:#800080;">$newhomemdblocation</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$homemdb</span><span style="color:#000000;">.replace(</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer1</span><span style="color:#800000;">"</span><span style="color:#000000;">,</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer1New</span><span style="color:#800000;">"</span><span style="color:#000000;">); </span><span style="color:#800080;">$newmsexchhomeservername</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$msexchhomeservername</span><span style="color:#000000;">.replace(</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer1</span><span style="color:#800000;">"</span><span style="color:#000000;">,</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer1New</span><span style="color:#800000;">"</span><span style="color:#000000;">);  </span><span style="color:#5f9ea0;font-weight:bold;">Set-QADUser</span><span style="color:#000000;"> </span><span style="color:#800080;">$user</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-style:italic;">-objectAttributes</span><span style="color:#000000;"> @{homemdb</span><span style="color:#ff0000;">=</span><span style="color:#800080;">$newhomemdblocation</span><span style="color:#000000;">;msexchhomeservername</span><span style="color:#ff0000;">=</span><span style="color:#800080;">$newmsexchhomeservername</span><span style="color:#000000;">;homemta</span><span style="color:#ff0000;">=</span><span style="color:#800080;">$newhomemta</span><span style="color:#000000;">}; </span><span style="color:#0000ff;">break</span><span style="color:#000000;">}</span><span style="color:#800000;">"</span><span style="color:#800000;">*ExchangeServer2*</span><span style="color:#800000;">"</span><span style="color:#000000;"> {</span><span style="color:#800080;">$newhomemdblocation</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$homemdb</span><span style="color:#000000;">.replace(</span><span style="color:#800000;">"</span>ExchangeServer2<span style="color:#800000;">"</span><span style="color:#000000;">,</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer2New</span><span style="color:#800000;">"</span><span style="color:#000000;">); </span><span style="color:#800080;">$newmsexchhomeservername</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$msexchhomeservername</span><span style="color:#000000;">.replace(</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer2</span><span style="color:#800000;">"</span><span style="color:#000000;">,</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer2New</span><span style="color:#800000;">"</span><span style="color:#000000;">);  </span><span style="color:#5f9ea0;font-weight:bold;">Set-QADUser</span><span style="color:#000000;"> </span><span style="color:#800080;">$user</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-style:italic;">-objectAttributes</span><span style="color:#000000;"> @{homemdb</span><span style="color:#ff0000;">=</span><span style="color:#800080;">$newhomemdblocation</span><span style="color:#000000;">;msexchhomeservername</span><span style="color:#ff0000;">=</span><span style="color:#800080;">$newmsexchhomeservername</span><span style="color:#000000;">;homemta</span><span style="color:#ff0000;">=</span><span style="color:#800080;">$newhomemta</span><span style="color:#000000;">}; </span><span style="color:#0000ff;">break</span><span style="color:#000000;">}</span><span style="color:#800000;">"</span><span style="color:#800000;">*ExchangeServer3*</span><span style="color:#800000;">"</span><span style="color:#000000;"> {</span><span style="color:#800080;">$newhomemdblocation</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$homemdb</span><span style="color:#000000;">.replace(</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer3</span><span style="color:#800000;">"</span><span style="color:#000000;">,</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer3New</span><span style="color:#800000;">"</span><span style="color:#000000;">); </span><span style="color:#800080;">$newmsexchhomeservername</span><span style="color:#000000;"> </span><span style="color:#ff0000;">=</span><span style="color:#000000;"> </span><span style="color:#800080;">$msexchhomeservername</span><span style="color:#000000;">.replace(</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer3</span><span style="color:#800000;">"</span><span style="color:#000000;">,</span><span style="color:#800000;">"</span><span style="color:#800000;">ExchangeServer3New</span><span style="color:#800000;">"</span><span style="color:#000000;">);  </span><span style="color:#5f9ea0;font-weight:bold;">Set-QADUser</span><span style="color:#000000;"> </span><span style="color:#800080;">$user</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-style:italic;">-objectAttributes</span><span style="color:#000000;"> @{homemdb</span><span style="color:#ff0000;">=</span><span style="color:#800080;">$newhomemdblocation</span><span style="color:#000000;">;msexchhomeservername</span><span style="color:#ff0000;">=</span><span style="color:#800080;">$newmsexchhomeservername</span><span style="color:#000000;">;homemta</span><span style="color:#ff0000;">=</span><span style="color:#800080;">$newhomemta</span><span style="color:#000000;">}; </span><span style="color:#0000ff;">break</span><span style="color:#000000;">}</span><span style="color:#0000ff;">default</span><span style="color:#000000;"> {</span><span style="color:#800000;">"</span><span style="color:#800000;">Nothing for this user</span><span style="color:#800000;">"</span><span style="color:#000000;">}}

}</span></pre>
<p>I was also interested to see the resulting performance of this script and was pleasantly surprised to see it change 6000+ accounts in only 10 mins.</p>
<p>A sidenote to this method is that you won&#8217;t actually see the mailboxes appear in Exchange System Manager until either they receive an email or a user logs on to them. To prove that this method had worked I created a quick Distribution Group, used the below one-liner to populate it with all of the above users and then sent an email to this group.</p>
<pre><span style="color:#5f9ea0;font-weight:bold;">Get-QADUser</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-style:italic;">-ldapFilter</span><span style="color:#000000;"> </span><span style="color:#800000;">'</span><span style="color:#800000;">(msExchHomeServerName=*ExchangeServer*)</span><span style="color:#800000;">'</span><span style="color:#000000;"> </span><span style="color:#5f9ea0;font-style:italic;">-sizelimit</span><span style="color:#000000;"> </span><span style="color:#000000;">0</span><span style="color:#000000;"> | </span><span style="color:#5f9ea0;font-weight:bold;">Add-QADGroupMember</span><span style="color:#000000;"> </span><span style="color:#800000;">TestGroup</span></pre>
<p>There are of course many different ways to carry out Exchange DR, but this proved a useful exercise.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmedd.net/2009/01/modifying-ad-accounts-with-powershell-after-an-exchange-2003-dial-tone-restore.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerGUI webcast &#8211; Exchange 2003 Powerpack demo</title>
		<link>http://www.jonathanmedd.net/2009/01/powergui-webcast-exchange-2003-powerpack-demo.html</link>
		<comments>http://www.jonathanmedd.net/2009/01/powergui-webcast-exchange-2003-powerpack-demo.html#comments</comments>
		<pubDate>Mon, 05 Jan 2009 22:31:00 +0000</pubDate>
		<dc:creator>Jonathan Medd</dc:creator>
				<category><![CDATA[exchange 2003]]></category>
		<category><![CDATA[powergui]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://jonathanmedd.wordpress.com/2009/01/05/powergui-webcast-exchange-2003-powerpack-demo/</guid>
		<description><![CDATA[I was recently invited to record a webcast by the Product Manager at Quest for PowerGUI, Darin Pendergraft, demoing the Exchange 2003 Powerpack I made for PowerGUI.
They came up with the idea to make some videos  / webcasts giving some community members the opportunity to show what PowerGUI can do. A lot of people [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently invited to record a <a href="http://www.powergui.org/documentation.jspa">webcast</a> by the Product Manager at Quest for PowerGUI, Darin Pendergraft, demoing the <a href="http://www.powergui.org/entry.jspa?externalID=1956&amp;categoryID=47">Exchange 2003 Powerpack</a> I made for PowerGUI.</p>
<p>They came up with the idea to make some videos  / webcasts giving some community members the opportunity to show what PowerGUI can do. A lot of people primarily use it only as a script editor, but the management console side of things is brilliant once you get into it &#8211; hopefully these examples will help inspire more people to make some powerpacks.</p>
<p>I had a lot of fun recording the interview, it was funny to be on the other end of the questions for once, normally I&#8217;m asking them for the <a href="http://get-scripting.blogspot.com">Get-Scripting podcast</a>.</p>
<p>It runs for about 15 &#8211; 20 mins, I hope you enjoy <a href="http://www.powergui.org/documentation.jspa">it</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmedd.net/2009/01/powergui-webcast-exchange-2003-powerpack-demo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
