<?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>AsniTech</title>
	<atom:link href="http://asnitech.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://asnitech.co.uk</link>
	<description>/blog</description>
	<lastBuildDate>Thu, 23 Feb 2012 10:36:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>:exchange2007 &#8211; Exporting all mailboxes to .PST</title>
		<link>http://asnitech.co.uk/44/exchange2007-exporting-all-mailboxes-to-pst/</link>
		<comments>http://asnitech.co.uk/44/exchange2007-exporting-all-mailboxes-to-pst/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 15:10:14 +0000</pubDate>
		<dc:creator>Asnivor</dc:creator>
				<category><![CDATA[exchange]]></category>
		<category><![CDATA[winScripting]]></category>
		<category><![CDATA[2007]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Export-Mailbox]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://asnitech.co.uk/?p=44</guid>
		<description><![CDATA[Recently I tasked with exporting all mailboxes on an Exchange 2007 server to PST files during a migration from one company to another. These are completely separate forests and for whatever reason they did not want a trust set up between the two to do this. I decided to go with the Export-Mailbox cmdlet within [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I tasked with exporting all mailboxes on an Exchange 2007 server to PST files during a migration from one company to another. These are completely separate forests and for whatever reason they did not want a trust set up between the two to do this.</p>
<p>I decided to go with the Export-Mailbox cmdlet within the Exchange Management Shell to achieve this, but it turns out there are a couple of hoops I had to jump through before being able to do this.</p>
<p>&nbsp;</p>
<p><span id="more-44"></span></p>
<p><span style="text-decoration: underline; color: #ff0000;"><strong>32-bit Exchange 2007</strong></span></p>
<p>&nbsp;</p>
<p>Firstly, you cannot just log into your Exchange 2007 server and run the Export-Mailbox command. Exchange 2007 runs on 64-bit windows and the Export-Mailbox command will only work on a 32-bit platform. I had to spin up a machine with a 32-bit OS (in this case XP SP3), join it to the domain and download and install the Exchange 2007 admin tools (choosing the relevant version for my Exchange service pack level):</p>
<p><a href="http://www.microsoft.com/download/en/details.aspx?id=11876">http://www.microsoft.com/download/en/details.aspx?id=11876</a></p>
<p>Once downloaded, the installer looks to be a full installer for Exchange 2007, so you have to choose &#8216;custom install&#8217; and select just the management tools option.</p>
<p>After this the setup checks that all necessary pre-reqs for Exchange are installed. Obviously they are not, but the installer doesn&#8217;t come bundled with these. It does give you &#8216;handy&#8217; links to a Microsoft Bing search site for each pre-req, but searching through this is painful at best and a waste of time at worst. You are better of googling the pre-reqs that are flagged up, download and install them. For me, these were:</p>
<ul>
<li>.NET Framework 2.0 SP1</li>
<li>Windows Installer 4.5</li>
<li>Windows PowerShell (it didn&#8217;t give me the version so I installed both 1.0 and 2.0)</li>
</ul>
<p>Once these were installed Exchange setup ran another check which told me I needed to install another couple of windows updates (which I did). Exchange setup then proceeds and installs in the usual way. Once done, I fire up the Exchange Management Shell and try out the Export-Mailbox cmdlet. It doesn&#8217;t work.</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><span style="color: #ff0000;"><strong>Microsoft Outlook 2003 SP2 or later&#8230;</strong></span></span></p>
<p>&nbsp;</p>
<p>You need Outlook installed on the 32-bit box for this cmdlet to work, possibly something to do with MAPI calls. Once this is installed (it doesn&#8217;t have to be set up) the Export-Mailbox cmdlet works but will error unless the account you are using has full access to the mailbox you are trying to export&#8230;</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><span style="color: #ff0000;"><strong>Access rights</strong></span></span></p>
<p>&nbsp;</p>
<p>I am logged into the 32-bit box as domain administrator. Best practice is to use a seperate account that only has the required level of access, but I did not have time for this.</p>
<p>In order to apply full access permissions for this account to all mailboxes, I used the Powershell command below. You will notice that this command is working on mailboxes in a particular OU rather than all the mailboxes in the mailbox database:<br />
<code>Get-Mailbox -OrganizationalUnit "OU-Name" | Add-MailboxPermission -user "Administrator" -AccessRights FullAccess</code><br />
This should step through every mailbox in the OU &#8216;<em>OU-Name</em>&#8216; and give the Administrator account the FullAccess right on each mailbox.</p>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><span style="color: #ff0000;"><strong>Exporting all mailboxes to PST</strong></span></span></p>
<p>&nbsp;</p>
<p>Once your logged on account has the necessary access rights to each mailbox you need to export, you can use the PowerShell command below:<br />
<code>Get-Mailbox -OrganizationalUnit "OU-Name" | Export-Mailbox -PSTFolderPath "c:\EmailArchive" -MaxThreads 4 -BadItemLimit 40</code><br />
So you can see this starts off the same as the previous Powershell script. It steps through every mailbox that resides in the &#8216;OU-Name&#8217; organisational unit and exports each mailbox to a PST in the format &#8216;<em>ExchangeAlias.pst</em>&#8216;.</p>
<ul>
<li><strong><em>-PSTFolderPath</em></strong> (this is the location you would like the generated PST files to be saved to)</li>
<li><strong><em>-MaxThreads 4</em></strong> (This enables 4 working threads at the same time. Compared to the default (1 thread) this appears to work at just over twice the speed when exporting a large number of mailboxes)</li>
<li><strong><em>-BadItemLimit 40</em></strong> (by default this is set to 0. This means that if during the export a corrupted message is detected, the export for that mailbox will not continue. In this scenario we were not bothered  if there were a few corrupted messages, so we put this limit at 40. be careful setting this above 50 as the export will halt and prompt you once the number of detected corruptions for a mailbox reaches this. In my experience, you rarely see more than 5-10, usually 1 or 2)</li>
</ul>
<div></div>
<div></div>
<div><span style="text-decoration: underline;"><span style="color: #ff0000;"><strong>Conclusion</strong></span></span></div>
<div></div>
<div></div>
<div>That&#8217;s about it. Be sure to check through the logs stored in the Exchange folder on your 32-bit box after the export has completed as there may be some problems that you will have to go back and look at.</div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div><span style="text-decoration: underline;"><span style="color: #ff0000;"><strong>References</strong></span></span></div>
<div></div>
<div></div>
<div>Exchange 2007 Admin Tools (x86) - <a href="http://www.microsoft.com/download/en/details.aspx?id=11876">http://www.microsoft.com/download/en/details.aspx?id=11876</a></div>
<div>Add-MailboxPermission - <a href="http://technet.microsoft.com/en-us/library/bb124097(v=exchg.80).aspx">http://technet.microsoft.com/en-us/library/bb124097(v=exchg.80).aspx</a></div>
<div>Export-mailbox - <a href="http://technet.microsoft.com/en-us/library/aa998579(v=exchg.80).aspx">http://technet.microsoft.com/en-us/library/aa998579(v=exchg.80).aspx</a></div>
<div></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://asnitech.co.uk/44/exchange2007-exporting-all-mailboxes-to-pst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>asnivor.com</title>
		<link>http://asnitech.co.uk/39/music-website/</link>
		<comments>http://asnitech.co.uk/39/music-website/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 16:23:20 +0000</pubDate>
		<dc:creator>Asnivor</dc:creator>
				<category><![CDATA[noiseGenerator]]></category>

		<guid isPermaLink="false">http://asnitech.co.uk/?p=39</guid>
		<description><![CDATA[I finally got around to getting my music blog up and running. Not a lot there at the moment but expect some new tunes in the not too distant future. http://asnivor.com]]></description>
			<content:encoded><![CDATA[<p>I finally got around to getting my music blog up and running. Not a lot there at the moment but expect some new tunes in the not too distant future.</p>
<p><a href="http://asnivor.com">http://asnivor.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://asnitech.co.uk/39/music-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>:asniTunes</title>
		<link>http://asnitech.co.uk/29/asnitunes/</link>
		<comments>http://asnitech.co.uk/29/asnitunes/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 12:54:12 +0000</pubDate>
		<dc:creator>Asnivor</dc:creator>
				<category><![CDATA[noiseGenerator]]></category>
		<category><![CDATA[oldschool]]></category>
		<category><![CDATA[psy]]></category>
		<category><![CDATA[techno]]></category>
		<category><![CDATA[trance]]></category>

		<guid isPermaLink="false">http://asnitech.co.uk/?p=29</guid>
		<description><![CDATA[In the past year I have been putting together some new tunes in genres I&#8217;m not used to working in (PsyTrance/Trance/Techno/OldSchool). Give them a listen @ http://reverbnation.com/asnivor &#38; http://myspace.com/asnivor.]]></description>
			<content:encoded><![CDATA[<p>In the past year I have been putting together some new tunes in genres I&#8217;m not used to working in (PsyTrance/Trance/Techno/OldSchool).</p>
<p>Give them a listen @ <a href="http://reverbnation.com/asnivor">http://reverbnation.com/asnivor</a> &amp; <a href="http://myspace.com/asnivor">http://myspace.com/asnivor</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://asnitech.co.uk/29/asnitunes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>:runAsAdmin</title>
		<link>http://asnitech.co.uk/15/runasadmin/</link>
		<comments>http://asnitech.co.uk/15/runasadmin/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 08:48:49 +0000</pubDate>
		<dc:creator>Asnivor</dc:creator>
				<category><![CDATA[winScripting]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[runas]]></category>
		<category><![CDATA[runasadmin]]></category>

		<guid isPermaLink="false">http://asnitech.co.uk/?p=15</guid>
		<description><![CDATA[I got tired of users calling me and wanting something installed on their PC through internet explorer (eg flash updates) and either having to log off and back on with an elevated account, or run IE (don&#8217;t ask) as an administrator. So, I wrote a little batch file to simplify the process&#8230;. mode con[:] [cols=50] [lines=100] [...]]]></description>
			<content:encoded><![CDATA[<p>I got tired of users calling me and wanting something installed on their PC through internet explorer (eg flash updates) and either having to log off and back on with an elevated account, or run IE (don&#8217;t ask) as an administrator.</p>
<p>So, I wrote a little batch file to simplify the process&#8230;.</p>
<pre>mode con[:] [cols=50] [lines=100]
ECHO off
:MENU
COLOR 3
CLS
ECHO .......................................................
ECHO RunAsAdmin.bat
ECHO .......................................................
ECHO.
ECHO (<a href="http://bitbucket.org/asnivor/runasadmin">http://bitbucket.org/asnivor/runasadmin</a>)
ECHO .......................................................
ECHO.
ECHO.
ECHO.
ECHO Enter Account to RunAs (in the form domain\accountname or accountname)
ECHO.
SET /P U=
ECHO.
ECHO.
ECHO 1 - CMD Prompt
ECHO 2 - Services
ECHO 3 - Computer Management
ECHO 4 - Device Manager
ECHO 5 - *Type a command*
ECHO 6 - Internet Explorer
ECHO.
ECHO.
ECHO 0 - EXIT
ECHO.
SET /P M=Type number then press ENTER:
IF %M%==1 GOTO CMD
IF %M%==2 GOTO SERVICES
IF %M%==3 GOTO COMPUTERMANAGEMENT
IF %M%==4 GOTO DEVICEMANAGER
IF %M%==5 GOTO TYPECOMMAND
IF %M%==6 GOTO IE
IF %M%==0 GOTO EOF
:CMD
COLOR 6
runas /user:%U% "cmd.exe"
GOTO MENU
:SERVICES
COLOR 6
runas /user:%U% "mmc services.msc"
GOTO MENU
:COMPUTERMANAGEMENT
COLOR 6
runas /user:%U% "mmc compmgmt.msc"
GOTO MENU
:DEVICEMANAGER
COLOR 6
runas /user:%U% "mmc devmgmt.msc"
GOTO MENU
:TYPECOMMAND
COLOR 6
CLS
SET /P A=Type command then press ENTER:
runas /user:%U% "%A%"
GOTO MENU
:IE
COLOR 6
runas /user:%U% "c:\program files\internet explorer\iexplore.exe"
GOTO MENU
:EOF
EXIT</pre>
<p>I&#8217;ve added a few more things to it (such as access to Device Manager, Computer Management etc) and it&#8217;s easily customisable so do what you like with it :)</p>
<p><a href="http://bitbucket.org/asnivor/runasadmin/">http://bitbucket.org/asnivor/runasadmin/</a><a href="http://bitbucket.org/admin/runasadmin"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://asnitech.co.uk/15/runasadmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>:helloWorld</title>
		<link>http://asnitech.co.uk/4/helloworld/</link>
		<comments>http://asnitech.co.uk/4/helloworld/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 08:10:08 +0000</pubDate>
		<dc:creator>Asnivor</dc:creator>
				<category><![CDATA[geekBlog]]></category>
		<category><![CDATA[noiseGenerator]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[techy]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://asnitech.co.uk/?p=4</guid>
		<description><![CDATA[So I finally got a blog site up and running. WordPress template creation seems to be quite enjoyable (and pretty easy) so I will have to stick at it. This is supposed to be a place where I can chuck some of the things I&#8217;m working on, along with any other techy ramblings and geeky [...]]]></description>
			<content:encoded><![CDATA[<p>So I finally got a blog site up and running. WordPress template creation seems to be quite enjoyable (and pretty easy) so I will have to stick at it.</p>
<p>This is supposed to be a place where I can chuck some of the things I&#8217;m working on, along with any other techy ramblings and geeky stuff. We&#8217;ll see how it goes&#8230;&#8230;.</p>
<p>EOF</p>
]]></content:encoded>
			<wfw:commentRss>http://asnitech.co.uk/4/helloworld/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

