<?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>Joe's Tech Blog</title>
	<atom:link href="http://www.joestechblog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joestechblog.com</link>
	<description>IT Support Notes, Tech Culture, Anything Geeky</description>
	<lastBuildDate>Mon, 26 Dec 2011 03:13:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to list the table size and rowcount for tables within a MSSQL DB</title>
		<link>http://www.joestechblog.com/2011/12/25/how-to-list-the-table-size-and-rowcount-for-tables-within-a-mssql-db/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-list-the-table-size-and-rowcount-for-tables-within-a-mssql-db</link>
		<comments>http://www.joestechblog.com/2011/12/25/how-to-list-the-table-size-and-rowcount-for-tables-within-a-mssql-db/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 03:13:27 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.joestechblog.com/?p=142</guid>
		<description><![CDATA[Incredibly handy query; originally from here. &#160; declare @RowCount int, @tablename varchar(100) declare @Tables table ( PK int IDENTITY(1,1), tablename varchar(100), processed bit ) INSERT into @Tables (tablename) SELECT TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_TYPE = 'BASE TABLE' and TABLE_NAME not like 'dt%' order by TABLE_NAME asc declare @Space table ( name varchar(100), rows nvarchar(100), reserved [...]]]></description>
			<content:encoded><![CDATA[<p>Incredibly handy query; originally from <a href="http://www.keyboardface.com/archives/2007/06/12/mssql-table-size-for-all-tables/">here</a>.</p>
<p>&nbsp;</p>
<pre><code>declare @RowCount int, @tablename varchar(100) declare @Tables table ( PK int IDENTITY(1,1), tablename varchar(100), processed bit ) INSERT into @Tables (tablename) SELECT TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_TYPE = 'BASE TABLE' and TABLE_NAME not like 'dt%' order by TABLE_NAME asc</code></pre>
<pre>declare @Space table (
name varchar(100), rows nvarchar(100), reserved varchar(100), data varchar(100), index_size varchar(100), unused varchar(100)
)
select top 1 @tablename = tablename from @Tables where processed is null
SET @RowCount = 1
WHILE (@RowCount &lt;&gt; 0)
BEGIN
insert into @Space exec sp_spaceused @tablename
update @Tables set processed = 1 where tablename = @tablename
select top 1 @tablename = tablename from @Tables where processed is null
SET @RowCount = @@RowCount
END</pre>
<pre>update @Space set data = replace(data, ' KB', '')
update @Space set data = convert(int, data)/1000
update @Space set data = data + ' MB'
update @Space set reserved = replace(reserved, ' KB', '')
update @Space set reserved = convert(int, reserved)/1000
update @Space set reserved = reserved + ' MB'</pre>
<pre><code>select * from @Space order by convert(int, replace(data, ' MB', '')) desc</code></pre>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.joestechblog.com%2F2011%2F12%2F25%2Fhow-to-list-the-table-size-and-rowcount-for-tables-within-a-mssql-db%2F&amp;t=How%20to%20list%20the%20table%20size%20and%20rowcount%20for%20tables%20within%20a%20MSSQL%20DB" id="facebook_share_link_142">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_142') || document.getElementById('facebook_share_icon_142') || document.getElementById('facebook_share_both_142') || document.getElementById('facebook_share_button_142');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_142') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.joestechblog.com/2011/12/25/how-to-list-the-table-size-and-rowcount-for-tables-within-a-mssql-db/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to give a user privileges on ALL databases in MSSQL</title>
		<link>http://www.joestechblog.com/2011/11/02/how-to-give-a-user-privileges-on-all-databases-in-mssql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-give-a-user-privileges-on-all-databases-in-mssql</link>
		<comments>http://www.joestechblog.com/2011/11/02/how-to-give-a-user-privileges-on-all-databases-in-mssql/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 23:57:40 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Tips for IT Pros]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.joestechblog.com/?p=138</guid>
		<description><![CDATA[USE master GO DECLARE @LoginName varchar(256) SET @LoginName ='joe' SELECT 'USE [' + Name + ']' + ';' + 'CREATE USER [' + @LoginName + '] FOR LOGIN [' + @LoginName + '] WITH DEFAULT_SCHEMA =dbo' + ';' + 'EXEC sp_addrolemember ''db_datareader'', '''+ @LoginName + '''' AS ScriptToExecute FROM sys.databases WHERE name NOT IN ('Master','tempdb','model','msdb') [...]]]></description>
			<content:encoded><![CDATA[<pre>USE master
GO
DECLARE @LoginName varchar(256)
SET @LoginName ='joe'

SELECT 'USE [' + Name + ']'
+ ';'
+ 'CREATE USER [' + @LoginName + '] FOR LOGIN [' + @LoginName + '] WITH DEFAULT_SCHEMA =dbo'
+ ';'
+ 'EXEC sp_addrolemember ''db_datareader'', '''+ @LoginName + ''''
AS ScriptToExecute

FROM sys.databases
WHERE name NOT IN ('Master','tempdb','model','msdb') -- Avoid System Databases
AND (state_desc ='ONLINE') -- Avoid Offline Databases
AND (source_database_id Is Null) -- Avoid Database Snapshot
ORDER BY Name</pre>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.joestechblog.com%2F2011%2F11%2F02%2Fhow-to-give-a-user-privileges-on-all-databases-in-mssql%2F&amp;t=How%20to%20give%20a%20user%20privileges%20on%20ALL%20databases%20in%20MSSQL" id="facebook_share_link_138">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_138') || document.getElementById('facebook_share_icon_138') || document.getElementById('facebook_share_both_138') || document.getElementById('facebook_share_button_138');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_138') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.joestechblog.com/2011/11/02/how-to-give-a-user-privileges-on-all-databases-in-mssql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to log all queries in MySQL Server</title>
		<link>http://www.joestechblog.com/2011/10/19/how-to-log-all-queries-in-mysql-server/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-log-all-queries-in-mysql-server</link>
		<comments>http://www.joestechblog.com/2011/10/19/how-to-log-all-queries-in-mysql-server/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 23:35:52 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.joestechblog.com/?p=134</guid>
		<description><![CDATA[For software development, finding a bug in your queries can be a complete pain, especially when the symptoms are inconsistent (i.e. it works fine sometimes, randomly fails to return or save data). There are a few different ways to run traces on your SQL queries; SQL Profiler for MSSQL is the best, but for MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>For software development, finding a bug in your queries can be a complete pain, especially when the symptoms are inconsistent (i.e. it works fine sometimes, randomly fails to return or save data). There are a few different ways to run traces on your SQL queries; SQL Profiler for MSSQL is the best, but for MySQL you can just enable basic logging to a text file by entering the following in your my.ini file.</p>
<pre>log = "D:/genquery.log"</pre>
<p>Be sure to restart the service&#8230;. This enables the MySQL General Query Log feature. It&#8217;s basically just a text file that MySQL pukes all the queries in-to. There&#8217;s no timestamp on them or anything so you&#8217;ll have to dig through it using a text-editor to track down the specific query you want though. More info on the <a href="http://dev.mysql.com/doc/refman/5.1/en/query-log.html">MySQL docs</a> site.</p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.joestechblog.com%2F2011%2F10%2F19%2Fhow-to-log-all-queries-in-mysql-server%2F&amp;t=How%20to%20log%20all%20queries%20in%20MySQL%20Server" id="facebook_share_link_134">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_134') || document.getElementById('facebook_share_icon_134') || document.getElementById('facebook_share_both_134') || document.getElementById('facebook_share_button_134');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_134') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.joestechblog.com/2011/10/19/how-to-log-all-queries-in-mysql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Headers to use for downloading a dynamically created CSV file</title>
		<link>http://www.joestechblog.com/2011/09/27/php-headers-to-use-for-downloading-a-dynamically-created-csv-file-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-headers-to-use-for-downloading-a-dynamically-created-csv-file-2</link>
		<comments>http://www.joestechblog.com/2011/09/27/php-headers-to-use-for-downloading-a-dynamically-created-csv-file-2/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 16:21:24 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.joestechblog.com/?p=132</guid>
		<description><![CDATA[I don&#8217;t always browse the web, but when I do, I prefer Google Chrome (Side-note: If you don&#8217;t get the reference, spend more time on reddit.com). Unfortunately, some people still like using IE. Some code I wrote that worked great on Chrome and Firefox didn&#8217;t cooperate with IE. These headers seemed to work consistently whereas [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t always browse the web, but when I do, I prefer Google Chrome (Side-note: If you don&#8217;t get the reference, spend more time on reddit.com). Unfortunately, some people still like using IE. Some code I wrote that worked great on Chrome and Firefox didn&#8217;t cooperate with IE. These headers seemed to work consistently whereas others (like leaving out the Pragma header) would result in IE throwing a &#8216;Cannot load this site&#8217; error when the Save dialog would open. The <a href="http://stackoverflow.com/questions/2232103/how-do-i-get-csv-file-to-download-on-ie-works-on-firefox">StackOverflow </a>forums have some other references in-case these don&#8217;t work for you.</p>
<pre style="padding-left: 30px;">header("Pragma: public");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=some_filename.csv");
echo $content;
die();</pre>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.joestechblog.com%2F2011%2F09%2F27%2Fphp-headers-to-use-for-downloading-a-dynamically-created-csv-file-2%2F&amp;t=PHP%20Headers%20to%20use%20for%20downloading%20a%20dynamically%20created%20CSV%20file" id="facebook_share_link_132">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_132') || document.getElementById('facebook_share_icon_132') || document.getElementById('facebook_share_both_132') || document.getElementById('facebook_share_button_132');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_132') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.joestechblog.com/2011/09/27/php-headers-to-use-for-downloading-a-dynamically-created-csv-file-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript: How to submit a form using the onchange event</title>
		<link>http://www.joestechblog.com/2011/09/26/javascript-how-to-submit-a-form-using-the-onchange-event/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=javascript-how-to-submit-a-form-using-the-onchange-event</link>
		<comments>http://www.joestechblog.com/2011/09/26/javascript-how-to-submit-a-form-using-the-onchange-event/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 18:18:19 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.joestechblog.com/?p=126</guid>
		<description><![CDATA[Specifically: How to submit a form using the OnChange event without hard-coding the name of the form in-to the event. I used to put the name of the form in the OnChange event but realized you can make it more dynamic. In this case, I have a PHP function that dynamically creates a select menu [...]]]></description>
			<content:encoded><![CDATA[<p>Specifically: How to submit a form using the OnChange event without hard-coding the name of the form in-to the event. I used to put the name of the form in the OnChange event but realized you can make it more dynamic. In this case, I have a PHP function that dynamically creates a select menu so it can be included in different forms throughout my app&#8230;hard-coding the form name was a bit unrealistic.</p>
<p>&nbsp;</p>
<pre>&lt;select name="Tonight_I_Shall_Dine_On" OnChange="<strong>javascript: this.form.submit()</strong>"&gt;</pre>
<pre>&lt;option value="bacon"&gt;Bacon&lt;/option&gt;</pre>
<pre>&lt;option value="cheese"&gt;Cheese&lt;/option&gt;</pre>
<pre>&lt;/select&gt;</pre>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.joestechblog.com%2F2011%2F09%2F26%2Fjavascript-how-to-submit-a-form-using-the-onchange-event%2F&amp;t=Javascript%3A%20How%20to%20submit%20a%20form%20using%20the%20onchange%20event" id="facebook_share_link_126">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_126') || document.getElementById('facebook_share_icon_126') || document.getElementById('facebook_share_both_126') || document.getElementById('facebook_share_button_126');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_126') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.joestechblog.com/2011/09/26/javascript-how-to-submit-a-form-using-the-onchange-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove whitespace from the end of fields in MSSQL resultsets</title>
		<link>http://www.joestechblog.com/2011/09/23/how-to-remove-whitespace-from-the-end-of-fields-in-mssql-resultsets/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-remove-whitespace-from-the-end-of-fields-in-mssql-resultsets</link>
		<comments>http://www.joestechblog.com/2011/09/23/how-to-remove-whitespace-from-the-end-of-fields-in-mssql-resultsets/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 14:25:49 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.joestechblog.com/?p=124</guid>
		<description><![CDATA[MSSQL only provides rtrim() and ltrim() functions for removing whitespace from your result-sets. I lurked around on some forums to find out why there&#8217;s no trim() function and the answer was somewhat obvious I guess: it would be redundant to have that since calling both isn&#8217;t very expensive and accomplishes what you need. To trim [...]]]></description>
			<content:encoded><![CDATA[<p>MSSQL only provides rtrim() and ltrim() functions for removing whitespace from your result-sets. I lurked around on some forums to find out why there&#8217;s no trim() function and the answer was somewhat obvious I guess: it would be redundant to have that since calling both isn&#8217;t very expensive and accomplishes what you need.</p>
<p>To trim from the right (in the case of having data in a CHAR field that&#8217;s padded-right):</p>
<pre>rtrim(fieldname)</pre>
<p>To trim from the left (in the case of having a lazy UI developer that didn&#8217;t validate form input before the insert statement):</p>
<pre>ltrim(fieldname)</pre>
<p>To trim both. call both:</p>
<pre>ltrim(rtrim(fieldname))</pre>
<p>&nbsp;</p>
<p>You could also create your <a href="http://www.devcha.com/2007/04/ms-sql-trim-function.html">own trim function</a> that&#8217;s just a wrapper for both but this makes your code less portable.</p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.joestechblog.com%2F2011%2F09%2F23%2Fhow-to-remove-whitespace-from-the-end-of-fields-in-mssql-resultsets%2F&amp;t=How%20to%20remove%20whitespace%20from%20the%20end%20of%20fields%20in%20MSSQL%20resultsets" id="facebook_share_link_124">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_124') || document.getElementById('facebook_share_icon_124') || document.getElementById('facebook_share_both_124') || document.getElementById('facebook_share_button_124');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_124') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.joestechblog.com/2011/09/23/how-to-remove-whitespace-from-the-end-of-fields-in-mssql-resultsets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exporting/Importing Mailboxes from Exchange 2007 using EMS</title>
		<link>http://www.joestechblog.com/2011/09/22/exportingimporting-mailboxes-from-exchange-2007-using-ems/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=exportingimporting-mailboxes-from-exchange-2007-using-ems</link>
		<comments>http://www.joestechblog.com/2011/09/22/exportingimporting-mailboxes-from-exchange-2007-using-ems/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 01:31:13 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Tips for IT Pros]]></category>
		<category><![CDATA[Server Management]]></category>

		<guid isPermaLink="false">http://www.joestechblog.com/?p=120</guid>
		<description><![CDATA[Many people fail to realize it but Exchange versions 2007 and newer come with a native utility to export and import PST files to/from your Exchange server. With previous versions you had to rely on third-party tools or use Microsoft&#8217;s EXMerge (which sucks, by the way&#8230;mostly because of the 2GB limit on their default ANSI [...]]]></description>
			<content:encoded><![CDATA[<p>Many people fail to realize it but Exchange versions 2007 and newer come with a native utility to export and import PST files to/from your Exchange server. With previous versions you had to rely on third-party tools or use Microsoft&#8217;s EXMerge (which sucks, by the way&#8230;mostly because of the 2GB limit on their default ANSI PST file, but I digress&#8230;). The commands here aren&#8217;t case-sensitive but CamelCase makes them easier to read.</p>
<p><strong>To export a PST file from Exchange:</strong></p>
<p><strong></strong>Give yourself the necessary rights:</p>
<p><span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">Add-MailboxPermission -Identity %username% -User %youradminusername% -AccessRights FullAccess</span></p>
<p>And then export the mailbox:</p>
<pre>Export-Mailbox -Identity %username% -PSTFolderPath %exportpath%</pre>
<p><strong>To import a PST file in-to Exchange: </strong></p>
<p>Give yourself the necessary rights:</p>
<pre>Add-MailboxPermission -Identity %username% -User %youradminusername% -AccessRights FullAccess</pre>
<p>And then import the mailbox:</p>
<pre>Import-Mailbox -Identity %username% -PSTFolderPath C:\pstexport\%username%.pst</pre>
<pre></pre>
<p>One important thing to know is that the default options for &#8216;Import-Mailbox&#8217; DO NOT create duplicates. So if your import fails for some reason, you can just re-run the import command and it will skip everything that&#8217;s already in the destination mailbox.</p>
<p>You can also do a cross export/import between mailboxes/stores if you want (although doing moves between MDBs is easy through the EMC UI). You can read more about that on the <a href="http://technet.microsoft.com/en-us/library/bb266964(EXCHG.80).aspx">Microsoft Exchange site</a>. There are a ton of other import options too, like only importing certain date ranges, etc&#8230; but I won&#8217;t go in-to that here. More info for import options is <a href="http://technet.microsoft.com/en-us/library/bb691363(EXCHG.80).aspx">here</a>.</p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.joestechblog.com%2F2011%2F09%2F22%2Fexportingimporting-mailboxes-from-exchange-2007-using-ems%2F&amp;t=Exporting%2FImporting%20Mailboxes%20from%20Exchange%202007%20using%20EMS" id="facebook_share_link_120">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_120') || document.getElementById('facebook_share_icon_120') || document.getElementById('facebook_share_both_120') || document.getElementById('facebook_share_button_120');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_120') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.joestechblog.com/2011/09/22/exportingimporting-mailboxes-from-exchange-2007-using-ems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to search all fields of all tables in MSSQL</title>
		<link>http://www.joestechblog.com/2011/09/13/how-to-search-all-fields-of-all-tables-in-mssql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-search-all-fields-of-all-tables-in-mssql</link>
		<comments>http://www.joestechblog.com/2011/09/13/how-to-search-all-fields-of-all-tables-in-mssql/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 23:48:18 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Tips for IT Pros]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.joestechblog.com/?p=116</guid>
		<description><![CDATA[Every developer has needed this at some point in time, especially when you&#8217;re dealing with a database schema that you didn&#8217;t create yourself. I found it here and am re-posting it for the sake of convenience. &#160; &#160; CREATE PROC SearchAllTables ( @SearchStr nvarchar(100) ) AS BEGIN -- Copyright © 2002 Narayana Vyas Kondreddi. All [...]]]></description>
			<content:encoded><![CDATA[<p>Every developer has needed this at some point in time, especially when you&#8217;re dealing with a database schema that you didn&#8217;t create yourself. I found it <a title="How to search all fields of all tables in MSSQL" href="http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm">here</a> and am re-posting it for the sake of convenience.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<pre>CREATE PROC SearchAllTables
(
	@SearchStr nvarchar(100)
)
AS
BEGIN

	-- Copyright © 2002 Narayana Vyas Kondreddi. All rights reserved.
	-- Purpose: To search all columns of all tables for a given search string
	-- Written by: Narayana Vyas Kondreddi
	-- Site: http://vyaskn.tripod.com
	-- Tested on: SQL Server 7.0 and SQL Server 2000
	-- Date modified: 28th July 2002 22:50 GMT

	CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630))

	SET NOCOUNT ON

	DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
	SET  @TableName = ''
	SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')

	WHILE @TableName IS NOT NULL
	BEGIN
		SET @ColumnName = ''
		SET @TableName =
		(
			SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME))
			FROM 	INFORMATION_SCHEMA.TABLES
			WHERE 		TABLE_TYPE = 'BASE TABLE'
				AND	QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) &gt; @TableName
				AND	OBJECTPROPERTY(
						OBJECT_ID(
							QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)
							 ), 'IsMSShipped'
						       ) = 0
		)

		WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)
		BEGIN
			SET @ColumnName =
			(
				SELECT MIN(QUOTENAME(COLUMN_NAME))
				FROM 	INFORMATION_SCHEMA.COLUMNS
				WHERE 		TABLE_SCHEMA	= PARSENAME(@TableName, 2)
					AND	TABLE_NAME	= PARSENAME(@TableName, 1)
					AND	DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar')
					AND	QUOTENAME(COLUMN_NAME) &gt; @ColumnName
			)

			IF @ColumnName IS NOT NULL
			BEGIN
				INSERT INTO #Results
				EXEC
				(
					'SELECT ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + ', 3630)
					FROM ' + @TableName + ' (NOLOCK) ' +
					' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2
				)
			END
		END
	END

	SELECT ColumnName, ColumnValue FROM #Results
END</pre>
<p><span style="font-family: Verdana; font-size: x-small;"><span style="color: blue; font-family: verdana; font-size: xx-small;"><br />
</span></span></p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.joestechblog.com%2F2011%2F09%2F13%2Fhow-to-search-all-fields-of-all-tables-in-mssql%2F&amp;t=How%20to%20search%20all%20fields%20of%20all%20tables%20in%20MSSQL" id="facebook_share_link_116">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_116') || document.getElementById('facebook_share_icon_116') || document.getElementById('facebook_share_both_116') || document.getElementById('facebook_share_button_116');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_116') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.joestechblog.com/2011/09/13/how-to-search-all-fields-of-all-tables-in-mssql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Function to strip everything except numbers from a string</title>
		<link>http://www.joestechblog.com/2011/09/12/php-function-to-strip-everything-except-numbers-from-a-string/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-function-to-strip-everything-except-numbers-from-a-string</link>
		<comments>http://www.joestechblog.com/2011/09/12/php-function-to-strip-everything-except-numbers-from-a-string/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 11:58:24 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Tips for IT Pros]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.joestechblog.com/?p=114</guid>
		<description><![CDATA[function numeric_only($string) { //function to strip characters other than numerals from a string $numString = ereg_replace("[^[:digit:]]", "", $string); return $numString; } Share on Facebook]]></description>
			<content:encoded><![CDATA[<pre>function numeric_only($string)
	{
    //function to strip characters other than numerals from a string
    $numString = ereg_replace("[^[:digit:]]", "", $string);
    return $numString;
	}</pre>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.joestechblog.com%2F2011%2F09%2F12%2Fphp-function-to-strip-everything-except-numbers-from-a-string%2F&amp;t=PHP%20Function%20to%20strip%20everything%20except%20numbers%20from%20a%20string" id="facebook_share_link_114">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_114') || document.getElementById('facebook_share_icon_114') || document.getElementById('facebook_share_both_114') || document.getElementById('facebook_share_button_114');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_114') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.joestechblog.com/2011/09/12/php-function-to-strip-everything-except-numbers-from-a-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google hates Microsoft</title>
		<link>http://www.joestechblog.com/2011/09/08/google-hates-microsoft/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=google-hates-microsoft</link>
		<comments>http://www.joestechblog.com/2011/09/08/google-hates-microsoft/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 23:13:44 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Things that bug me]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.joestechblog.com/?p=108</guid>
		<description><![CDATA[Part of my day-job requires writing a lot of SQL queries. I recently started digging into more in-depth queries than I&#8217;m used to so I started doing some more research (ala Google). I didn&#8217;t get very far before realizing that the results of my searches that included &#8220;MSSQL&#8221; in the search string were automatically changed [...]]]></description>
			<content:encoded><![CDATA[<p>Part of my day-job requires writing a lot of SQL queries. I recently started digging into more in-depth queries than I&#8217;m used to so I started doing some more research (ala Google). I didn&#8217;t get very far before realizing that the results of my searches that included &#8220;MSSQL&#8221; in the search string were automatically changed to &#8220;mysql&#8221; by default. The suggested corrections that Google provides are usually <a href="http://www.google.com/jobs/britney.html">pretty useful</a>, but it seems kinda odd that a very specific (aka not misspelled) term is automatically and consistently replaced with a different (and competing) term. Not that it really matters&#8230;just had to click a second time to search for what I already typed in and tried to search for the first time.</p>
<p><a href="http://www.joestechblog.com/wp-content/uploads/2011/09/google_hates_microsoft.jpg"><img class="aligncenter size-full wp-image-109" title="Google Hates Microsoft - MSSQL Search Results" src="http://www.joestechblog.com/wp-content/uploads/2011/09/google_hates_microsoft.jpg" alt="Google Hates Microsoft - MSSQL Search Results" width="670" height="411" /></a></p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.joestechblog.com%2F2011%2F09%2F08%2Fgoogle-hates-microsoft%2F&amp;t=Google%20hates%20Microsoft" id="facebook_share_link_108">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_108') || document.getElementById('facebook_share_icon_108') || document.getElementById('facebook_share_both_108') || document.getElementById('facebook_share_button_108');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_108') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://www.joestechblog.com/2011/09/08/google-hates-microsoft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

