<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Shawn Melton</title>
	<atom:link href="http://meltondba.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://meltondba.wordpress.com</link>
	<description>Leaning all things SQL Server and PowerShell</description>
	<lastBuildDate>Tue, 10 Jan 2012 14:03:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='meltondba.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/74be2f6af52c7e6a54e1ecd1f03acff9?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Shawn Melton</title>
		<link>http://meltondba.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://meltondba.wordpress.com/osd.xml" title="Shawn Melton" />
	<atom:link rel='hub' href='http://meltondba.wordpress.com/?pushpress=hub'/>
		<item>
		<title>If you find it, show them</title>
		<link>http://meltondba.wordpress.com/2012/01/10/if-you-find-it-show-them/</link>
		<comments>http://meltondba.wordpress.com/2012/01/10/if-you-find-it-show-them/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 14:00:00 +0000</pubDate>
		<dc:creator>Shawn Melton</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[GRANT Permissions]]></category>
		<category><![CDATA[Permissions]]></category>

		<guid isPermaLink="false">https://meltondba.wordpress.com/?p=564</guid>
		<description><![CDATA[I was tooling around in SSMS the other day. In this particular instance I was granting a login instance-level permissions to test out a third party application at work. I did not want to give it sysadmin privileges for this so I just started out with giving it VIEW SERVER STATE (which most DMVs require [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=564&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was tooling around in SSMS the other day. In this particular instance I was granting a login instance-level permissions to test out a third party application at work. I did not want to give it sysadmin privileges for this so I just started out with giving it VIEW SERVER STATE (which most DMVs require in order to query them) and VIEW ANY DATABASE. [If you have never heard of these permissions, check out this little tidbit of info <a href="http://www.mssqltips.com/sqlservertip/1714/server-level-permissions-for-sql-server-2005-and-sql-server-2008/" target="_blank">here</a> from Brian Kelley (<a href="http://www.truthsolutions.com/" target="_blank">b</a>|<a href="http://twitter.com/kbriankelley" target="_blank">t</a>).)</p>
<p>Wait…go and actually read the tidbit of info from Brian...</p>
<p>Ok now that you have read that, you saw the T-SQL code to find the server-level permissions granted to any account on an instance of SQL Server 2005 or 2008. Well what if I only wanted it for one login and I wanted to use the GUI? Ah, ha!!!</p>
<p>So on my test system at home I have [myUser], with the current permissions showing below (retrieved using Brian’s T-SQL code).</p>
<p><a href="http://meltondba.files.wordpress.com/2012/01/current_perms.jpg"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="Current_Perms" border="0" alt="Current_Perms" src="http://meltondba.files.wordpress.com/2012/01/current_perms_thumb.jpg?w=578&#038;h=74" width="578" height="74" /></a></p>
<p>Now I am going to grant the account VIEW SERVER STATE and VIEW ANY DATABASE. Running the T-SQL code again will show you this:</p>
<p><a href="http://meltondba.files.wordpress.com/2012/01/new_perms_tsql.jpg"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="New_Perms_tsql" border="0" alt="New_Perms_tsql" src="http://meltondba.files.wordpress.com/2012/01/new_perms_tsql_thumb.jpg?w=601&#038;h=122" width="601" height="122" /></a></p>
<p>Now how can you see this using SSMS, you ask? …I’m glad you asked. Open up SSMS and go to the properties of your login you are interested in, click on “Securables” in the left pane. You should see this window:</p>
<p><a href="http://meltondba.files.wordpress.com/2012/01/securables_empty.jpg"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="Securables_empty" border="0" alt="Securables_empty" src="http://meltondba.files.wordpress.com/2012/01/securables_empty_thumb.jpg?w=537&#038;h=484" width="537" height="484" /></a></p>
<p>Now click on the “Search” button. You are presented with options as to what objects you want SSMS to search for, I chose “The server…”. You can play around later to see what the options do if you like, these selections are not remembered so once you close the window they go away. After clicking OK you will see your instance name show up under Securables and the bottom pain will show all the instance level permissions. I scroll all the way to the bottom and will see the permissions I assigned to my login:</p>
<p><a href="http://meltondba.files.wordpress.com/2012/01/securables_showing.jpg"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="Securables_showing" border="0" alt="Securables_showing" src="http://meltondba.files.wordpress.com/2012/01/securables_showing_thumb.jpg?w=552&#038;h=510" width="552" height="510" /></a></p>
<p>That is all for now…</p>
<br /> Tagged: <a href='http://meltondba.wordpress.com/tag/grant-permissions/'>GRANT Permissions</a>, <a href='http://meltondba.wordpress.com/tag/permissions/'>Permissions</a>, <a href='http://meltondba.wordpress.com/tag/sql-server/'>SQL Server</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltondba.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltondba.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltondba.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltondba.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltondba.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltondba.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltondba.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltondba.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltondba.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltondba.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltondba.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltondba.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltondba.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltondba.wordpress.com/564/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=564&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltondba.wordpress.com/2012/01/10/if-you-find-it-show-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dbf204269ac38e91e00d5a7add6067b9?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">meltondba</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2012/01/current_perms_thumb.jpg" medium="image">
			<media:title type="html">Current_Perms</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2012/01/new_perms_tsql_thumb.jpg" medium="image">
			<media:title type="html">New_Perms_tsql</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2012/01/securables_empty_thumb.jpg" medium="image">
			<media:title type="html">Securables_empty</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2012/01/securables_showing_thumb.jpg" medium="image">
			<media:title type="html">Securables_showing</media:title>
		</media:content>
	</item>
		<item>
		<title>Mentoree</title>
		<link>http://meltondba.wordpress.com/2011/10/27/mentoree/</link>
		<comments>http://meltondba.wordpress.com/2011/10/27/mentoree/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 11:00:05 +0000</pubDate>
		<dc:creator>Shawn Melton</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Religious]]></category>
		<category><![CDATA[Mentoring]]></category>

		<guid isPermaLink="false">http://meltondba.wordpress.com/?p=459</guid>
		<description><![CDATA[Fair warning that some religous terminology may be mentioned in this blog post, continue reading at your own risk. I recently took part in the first round of the Mentoring Experiment. This is a program that Steve Jones (t&#124;b) and Andy Warren (t&#124;b) started (they seem to do that alot). I acted as the mentoree [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=459&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_457" class="wp-caption alignnone" style="width: 160px"><a href="http://meltondba.files.wordpress.com/2011/10/cpbxt.jpg"><img class="size-thumbnail wp-image-457" title="cPbxt" src="http://meltondba.files.wordpress.com/2011/10/cpbxt.jpg?w=150&#038;h=99" alt="" width="150" height="99" /></a><p class="wp-caption-text">A loyal guide</p></div>
<p><strong><span style="color:#ff0000;">Fair warning that some religous terminology may be mentioned in this blog post, continue reading at your own risk.</span></strong></p>
<p>I recently took part in the first round of the <a href="http://thementoringexperiment.org/">Mentoring Experiment</a>. This is a program that Steve Jones (<a href="http://twitter.com/way0utwest" target="_blank">t</a>|<a href="http://www.voiceofthedba.com/" target="_blank">b</a>) and Andy Warren (<a href="http://twitter.com/sqlandy" target="_blank">t</a>|<a href="http://www.sqlandy.com" target="_blank">b</a>) started (they seem to do that <a href="http://thementoringexperiment.org/index.php/about-us/" target="_blank">alot</a>).</p>
<p>I acted as the mentoree and had someone mentor me. Overall it was a great experience. I want to send my thanks out to Steve and Andy for allowing me to participate. The plan of the was for me and my mentor to schedule a few phones calls each month to talk about different things. We talked about where I wanted my career to go, and where I was at currently. I got some good advice from it on how to grow my knowledge and get more involved with things. I greatly appreciate my mentor sharing that time away from his family each month during this program trial.</p>
<p>I would advise anyone interested in SQL Server, especially if you are just starting out with it, to watch the Mentoring website I linked to above for the second cycle to start up. It can help you get your plan written out to where you want to go with your career. Having someone that has been through it already is a great way for you to learn what things work and what does not.</p>
<p>The main thing I have learned is that I need to build those skillsets that best match up to what I want to do. If I don&#8217;t then I won&#8217;t go any further than where I am at right now. I have the belief that God has a plan for me and my career. What the end result will be I do not know and don&#8217;t want to know, the fun part is the journey.</p>
<br /> Tagged: <a href='http://meltondba.wordpress.com/tag/mentoring/'>Mentoring</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltondba.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltondba.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltondba.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltondba.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltondba.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltondba.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltondba.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltondba.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltondba.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltondba.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltondba.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltondba.wordpress.com/459/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltondba.wordpress.com/459/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltondba.wordpress.com/459/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=459&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltondba.wordpress.com/2011/10/27/mentoree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dbf204269ac38e91e00d5a7add6067b9?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">meltondba</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2011/10/cpbxt.jpg?w=150" medium="image">
			<media:title type="html">cPbxt</media:title>
		</media:content>
	</item>
		<item>
		<title>Adjusting and learning</title>
		<link>http://meltondba.wordpress.com/2011/08/18/adjusting-and-learning/</link>
		<comments>http://meltondba.wordpress.com/2011/08/18/adjusting-and-learning/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 13:00:04 +0000</pubDate>
		<dc:creator>Shawn Melton</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[hash table]]></category>

		<guid isPermaLink="false">http://meltondba.wordpress.com/?p=407</guid>
		<description><![CDATA[Short and sweet post here&#8230;not the sugar sweet, the awesome sweet!!! So I&#8217;m still working on the script I talked about in a previous post. I wanted to try to drop using the parameter and try to work it all out in the script if it comes across more than one instance. So I came [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=407&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Short and sweet post here&#8230;not the sugar sweet, the awesome sweet!!!</p>
<p>So I&#8217;m still working on the script I talked about in a <a href="http://meltondba.wordpress.com/2011/08/01/what-a-few-lines-of-code-can-do/" target="_blank">previous post</a>. I wanted to try to drop using the parameter and try to work it all out in the script if it comes across more than one instance.</p>
<p>So I came up with this, initially:<br />
<code><br />
$regInstance = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server').InstalledInstances<br />
if ($regInstance.Count &gt; 1)<br />
{<br />
   "More than one instance found on server."<br />
   foreach ($ins in $regInstance)<br />
   {<br />
     $regPath = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL').$ins<br />
     $fullpath = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$regpath"<br />
   }<br />
}<br />
else<br />
{<br />
   $regPath = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL').$ins<br />
   $fullpath = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$regpath"<br />
}<br />
</code></p>
<p>So that was nice, but you probably already noticed an issue? The way it is written the $fullpath will only have the last value it hits in the foreach loop, if more than one SQL instance exist. That will not work. So where do we turn&#8230;hash tables. How you might ask? While we pause for station identification, go read this <a href="http://blogs.technet.com/b/heyscriptingguy/archive/2011/07/05/automatically-create-a-powershell-hash-table.aspx" target="_blank">post</a> from The Scripting Guy! Blog.</p>
<p>The example in that post that helped me was adding 100 intergers as key/value pairs in a hash table. I could capture both the InstalledInstances and the Instance Names values, and keep them associated with each other  in a hash table. This improves the options I have of reusing this snippet in other scripts possibly. (One example comes to mind is being able to pass the instance name in SMO scripts.)</p>
<p>So the 18 lines of code from above, turned into this:<br />
<code><br />
#create hash table<br />
$hashInst = @{}<br />
#populate hash table with values<br />
</code><code>$inst = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server').InstalledInstances<br />
foreach ($i in $inst)<br />
{<br />
   $hashInst.Add($i,(Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL').$i)<br />
}<br />
</code><br />
A total of just 6 lines of code for readability, could go down to 3 if you put the foreach on one line.</p>
<br /> Tagged: <a href='http://meltondba.wordpress.com/tag/hash-table/'>hash table</a>, <a href='http://meltondba.wordpress.com/tag/powershell/'>PowerShell</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltondba.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltondba.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltondba.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltondba.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltondba.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltondba.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltondba.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltondba.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltondba.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltondba.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltondba.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltondba.wordpress.com/407/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltondba.wordpress.com/407/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltondba.wordpress.com/407/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=407&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltondba.wordpress.com/2011/08/18/adjusting-and-learning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dbf204269ac38e91e00d5a7add6067b9?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">meltondba</media:title>
		</media:content>
	</item>
		<item>
		<title>What a few lines of code can do</title>
		<link>http://meltondba.wordpress.com/2011/08/01/what-a-few-lines-of-code-can-do/</link>
		<comments>http://meltondba.wordpress.com/2011/08/01/what-a-few-lines-of-code-can-do/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 13:00:00 +0000</pubDate>
		<dc:creator>Shawn Melton</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Windows Registry]]></category>

		<guid isPermaLink="false">http://meltondba.wordpress.com/?p=396</guid>
		<description><![CDATA[You find out PowerShell is fun when you start playing with it and actually try to perform a task with it. I have been using it the past few months to try and decrease the time it takes me to perform a scan of a SQL Server. What I mean by scan is I work [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=396&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You find out PowerShell is fun when you start playing with it and actually try to perform a task with it. I have been using it the past few months to try and decrease the time it takes me to perform a scan of a SQL Server. What I mean by scan is I work with the IASE Security Technical Implementation Guide checklist (STIG). You can find the checklist for SQL Server <a href="http://iase.disa.mil/stigs/app_security/database/sql.html" target="_blank">here</a>, they have not published one for SQL 2008 so I just use the SQL 2005 checklist for now.</p>
<p>Anyway some of the findings in that checklist have you check configuration settings that could be checked through SSMS or through registry keys. I prefer to check registry keys or use SQL SMO if I can, cause guess what&#8230;PowerShell can do it for me.</p>
<p>I am not going to provide the complete script right now cause it is still a work in progress. I have a parameter required to pass with the script, the instance name. I was just using that to connect with SQL SMO, but now I have just figured out how I can use that with looking at the registry.</p>
<p>With a SQL Server installs (SQL 2005 and higher) it adds a registry hive of &#8220;HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server&#8221;. To really get deeper than that you have to know what the path is for the instance and it varies between SQL Server versions and default/named instances. In SQL Server 2005 it is MSSQL.# (# being a number between 1 &#8211; 9). With SQL Server 2008 it changed to MSSQL10.&lt;InstanceName&gt; and SQL 2008 R2 it is MSSQL10_50.&lt;Instance Name&gt;. So if you were working with a default instance the path for SQL Server 2008 and R2 would be MSSQL10.MSSQLSERVER or MSSQL10_50.MSSQLSERVER. With SQL Server 2005 it would be your best guess cause if there are multiple instances it will depend on the order it was installed. If the default instance was first it would be MSSQL.1, then any named instance after that would have that number incremented.</p>
<p>Needless to say it took me a few minutes to get it down right but this is the code I came up with, and there is probably another way of doing it (or even doing it with less). I have not tested it on every version of SQL Server. If I come across any bugs I will update this post.</p>
<p><em>Note: $InstnaceName is the variable used to pull in the parameter passed when calling the script.</em></p>
<div class="code"><span style="color:#008040;">#find registry path to work with for the instance <br />
</span><span style="color:#2b91af;">$regInstance</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> </span><span style="color:#000000;">(</span><span style="color:#0000ff;">Get-ItemProperty</span><span style="color:#808080;"> &#8216;HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server&#8217;</span><span style="color:#000000;">).InstalledInstances</span><span style="color:#808080;"> <br />
</span><span style="color:#008040;">#build registry path to output according to instance name passed with script</span><span style="color:#808080;"> <br />
</span><span style="color:#0000ff;">if</span><span style="color:#808080;"> </span><span style="color:#000000;">(</span><span style="color:#2b91af;">$InstanceName</span><span style="color:#808080;"> </span><span style="color:#0000ff;">-eq</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$env</span><span style="color:#000000;">:COMPUTERNAME)</span><span style="color:#808080;"> <br />
</span><span style="color:#000000;">{</span><span style="color:#808080;"> <br />
</span><span style="color:#008040;">#default instance</span><span style="color:#808080;"> <br />
</span><span style="color:#2b91af;">$currentValue</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$regInstance</span><span style="color:#808080;"> </span><span style="color:#000000;">|</span><span style="color:#808080;"> </span><span style="color:#0000ff;">Where-Object</span><span style="color:#808080;"> </span><span style="color:#000000;">{</span><span style="color:#2b91af;">$_</span><span style="color:#808080;"> </span><span style="color:#0000ff;">-eq</span><span style="color:#808080;"> &#8220;MSSQLSERVER&#8221;</span><span style="color:#000000;">}</span><span style="color:#808080;"> <br />
</span><span style="color:#2b91af;">$regPath</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> </span><span style="color:#000000;">(</span><span style="color:#0000ff;">Get-ItemProperty</span><span style="color:#808080;"> &#8216;HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL&#8217;</span><span style="color:#000000;">).</span><span style="color:#2b91af;">$currentValue</span><span style="color:#808080;"> <br />
</span><span style="color:#2b91af;">$fullpath</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> &#8220;HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$regpath&#8221; <br />
</span><span style="color:#000000;">}</span><span style="color:#808080;"> <br />
</span><span style="color:#0000ff;">else</span><span style="color:#808080;"> <br />
</span><span style="color:#000000;">{</span><span style="color:#808080;"> <br />
</span><span style="color:#008040;">#named instance passed <br />
</span><span style="color:#2b91af;">$currentValue</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$regInstance</span><span style="color:#808080;"> </span><span style="color:#000000;">|</span><span style="color:#808080;"> </span><span style="color:#0000ff;">Where-Object</span><span style="color:#808080;"> </span><span style="color:#000000;">{</span><span style="color:#2b91af;">$_</span><span style="color:#808080;"> </span><span style="color:#0000ff;">-eq</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$InstanceName</span><span style="color:#000000;">}</span><span style="color:#808080;"> <br />
</span><span style="color:#2b91af;">$regPath</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> </span><span style="color:#000000;">(</span><span style="color:#0000ff;">Get-ItemProperty</span><span style="color:#808080;"> &#8216;HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL&#8217;</span><span style="color:#000000;">).</span><span style="color:#2b91af;">$currentValue</span><span style="color:#808080;"> <br />
</span><span style="color:#2b91af;">$fullpath</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> &#8220;HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$regpath&#8221; <br />
</span><span style="color:#000000;">}</span><span style="color:#808080;"> </span></div>
<br /> Tagged: <a href='http://meltondba.wordpress.com/tag/powershell/'>PowerShell</a>, <a href='http://meltondba.wordpress.com/tag/sql-server/'>SQL Server</a>, <a href='http://meltondba.wordpress.com/tag/windows-registry/'>Windows Registry</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltondba.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltondba.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltondba.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltondba.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltondba.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltondba.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltondba.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltondba.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltondba.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltondba.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltondba.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltondba.wordpress.com/396/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltondba.wordpress.com/396/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltondba.wordpress.com/396/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=396&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltondba.wordpress.com/2011/08/01/what-a-few-lines-of-code-can-do/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dbf204269ac38e91e00d5a7add6067b9?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">meltondba</media:title>
		</media:content>
	</item>
		<item>
		<title>Look what I did with PowerShell</title>
		<link>http://meltondba.wordpress.com/2011/07/26/look-what-i-did-with-powershell/</link>
		<comments>http://meltondba.wordpress.com/2011/07/26/look-what-i-did-with-powershell/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 13:00:00 +0000</pubDate>
		<dc:creator>Shawn Melton</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[RDP File]]></category>
		<category><![CDATA[Remote Desktop]]></category>
		<category><![CDATA[Shawn Melton]]></category>

		<guid isPermaLink="false">https://meltondba.wordpress.com/2011/07/26/look-what-i-did-with-powershell/</guid>
		<description><![CDATA[I was pretty excited that work was finally going to install Remote Desktop Connection Manager v2.2 on our laptops, until I started using it. It is nice if you work on one server at a time but sometimes I multitask while something is running, or I need to compare something to the results on another [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=394&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was pretty excited that work was finally going to install <a href="http://www.microsoft.com/download/en/details.aspx?id=21101" target="_blank">Remote Desktop Connection Manager v2.2</a> on our laptops, until I started using it. It is nice if you work on one server at a time but sometimes I multitask while something is running, or I need to compare something to the results on another server. You can “undock” the window and then go to full screen like you would with the regular Remote Desktop Connection, however you have to do that for each server and each time after closing it.</p>
<p>So I decided to go back to RDP files, using Remote Desktop Connection. I did not want to go through the process of having to create those files all over again. So guess what I wanted to do? That’s right, see if PowerShell could do it for me.</p>
<p>A quick search on Google I came across a post from the Windows PowerShell Blog on <a href="http://blogs.msdn.com/b/powershell/archive/2008/09/14/rdp-file-generation-use-of-here-strings.aspx" target="_blank">RDP file generation</a>. The post is actually a review of a script someone wrote and blogged about that will <a href="http://everydaynerd.com/microsoft/create-multiple-rdp-files-with-powershell" target="_blank">create multiple RDP files with PowerShell</a>. Which the original author of this script is lost since the link to the author of the script is dead.</p>
<p>Anyway, I decided to start with this script but do a few things differently. As well, the PowerShell Team mentioned one of the flaws in the guy’s script is it is dependent upon a CSV file, something developers may call “hard coded”. I wanted to make it more portable and useful for other folks to use.</p>
<p>My script assumes the current directory so where you run the script from is where the files will be created. I did not care about creating directories or creating RDP file with different resolution settings. If you do, you are more than welcome to adjust the script to your preferences.</p>
<p>The script has three (3) parameters to pass, with two being required and the third one is optional. The first position is the $server that you want to connect to in the RDP file. The second being your RDP file template (I’ll explain how I created mine). Then the third and optional parameter, is the username for that RDP file. I don’t usually put my username in the RDP file due to the environment I work in, but you may want to.</p>
<p>Ok, first how I created the RDP template file. I open up Remote Desktop Connection (from the run prompt: mstsc.exe). Go into the options and set everything as you like (Display, Local Resources, etc.). Then under the General tab click “Save As…”. Save the file to your desktop or where you saved the script, giving it a name of your liking. Then using Notepad open that file up and you will see something similar to this:</p>
<p>&nbsp;</p>
<p>The highlighted line is what you want to remove and then save the file. This line will be added by the script and include your server name you pass.</p>
<p>So here is the script…(download <a href="https://skydrive.live.com/?cid=fefce09845129be8&amp;sc=documents&amp;id=FEFCE09845129BE8%21214#" target="_blank">here</a>)</p>
<blockquote>
<div class="code">
<p><span style="color:#000000;">param(</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">[Parameter(Position</span><span style="color:#0000ff;">=</span><span style="color:#800000;">0</span><span style="color:#000000;">,Mandatory</span><span style="color:#0000ff;">=</span><span style="color:#2b91af;">$True</span><span style="color:#000000;">)]</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">[string]</span><span style="color:#2b91af;">$server</span><span style="color:#000000;">,</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">[Parameter(Position</span><span style="color:#0000ff;">=</span><span style="color:#800000;">1</span><span style="color:#000000;">,Mandatory</span><span style="color:#0000ff;">=</span><span style="color:#2b91af;">$True</span><span style="color:#000000;">)]</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">[string]</span><span style="color:#2b91af;">$MyDefaultRDP</span><span style="color:#000000;">,</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">[Parameter(Position</span><span style="color:#0000ff;">=</span><span style="color:#800000;">2</span><span style="color:#000000;">,Mandatory</span><span style="color:#0000ff;">=</span><span style="color:#2b91af;">$False</span><span style="color:#000000;">)]</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">[string]</span><span style="color:#2b91af;">$myaccount</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">)</span><span style="color:#808080;">  </span></p>
<p><span style="color:#0000ff;">ForEach</span><span style="color:#000000;">(</span><span style="color:#2b91af;">$entry</span><span style="color:#808080;"> </span><span style="color:#000000;">in</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$server</span><span style="color:#000000;">)</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">{</span><span style="color:#808080;"><br />
</span><span style="color:#0000ff;">#</span><span style="color:#000000;">build</span><span style="color:#808080;"> </span><span style="color:#000000;">the</span><span style="color:#808080;"> </span><span style="color:#000000;">file</span><span style="color:#808080;"><br />
</span><span style="color:#0000ff;">#</span><span style="color:#000000;">assumes</span><span style="color:#808080;"> </span><span style="color:#000000;">current</span><span style="color:#808080;"> </span><span style="color:#000000;">directory</span><span style="color:#808080;"><br />
</span><span style="color:#2b91af;">$filename</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> &#8220;.\&#8221; </span><span style="color:#000000;">+</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$entry</span><span style="color:#808080;"> </span><span style="color:#000000;">+</span><span style="color:#808080;"> &#8220;.rdp&#8221;</p>
<p></span><span style="color:#0000ff;">#</span><span style="color:#808080;"> </span><span style="color:#000000;">Add</span><span style="color:#808080;"> </span><span style="color:#000000;">hostname</span><span style="color:#808080;"> </span><span style="color:#000000;">in</span><span style="color:#808080;"> </span><span style="color:#000000;">RDP</span><span style="color:#808080;"> </span><span style="color:#000000;">file</span><span style="color:#808080;"><br />
</span><span style="color:#2b91af;">$temp</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> &#8220;full address:s:&#8221; </span><span style="color:#000000;">+</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$Entry</span><span style="color:#808080;"></p>
<p></span><span style="color:#0000ff;">#</span><span style="color:#000000;">test</span><span style="color:#808080;"> </span><span style="color:#000000;">for</span><span style="color:#808080;"> </span><span style="color:#000000;">username,</span><span style="color:#808080;"> </span><span style="color:#0000ff;">if</span><span style="color:#808080;"> </span><span style="color:#000000;">empty</span><span style="color:#808080;"> </span><span style="color:#000000;">it</span><span style="color:#808080;"> </span><span style="color:#000000;">will</span><span style="color:#808080;"> </span><span style="color:#000000;">not</span><span style="color:#808080;"> </span><span style="color:#000000;">be</span><span style="color:#808080;"> </span><span style="color:#000000;">added</span><span style="color:#808080;"><br />
</span><span style="color:#0000ff;">if</span><span style="color:#808080;"> </span><span style="color:#000000;">(</span><span style="color:#2b91af;">$myaccount</span><span style="color:#000000;">)</span><span style="color:#808080;"> </span><span style="color:#000000;">{</span><span style="color:#808080;"><br />
</span><span style="color:#2b91af;">$temp</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$temp</span><span style="color:#808080;"> </span><span style="color:#000000;">+</span><span style="color:#808080;"> &#8220;`nusername:s:&#8221; </span><span style="color:#000000;">+</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$myaccount</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">}</span><span style="color:#808080;"><br />
</span><span style="color:#0000ff;">#</span><span style="color:#000000;">check</span><span style="color:#808080;"> </span><span style="color:#000000;">to</span><span style="color:#808080;"> </span><span style="color:#000000;">see</span><span style="color:#808080;"> </span><span style="color:#0000ff;">if</span><span style="color:#808080;"> </span><span style="color:#000000;">file</span><span style="color:#808080;"> </span><span style="color:#000000;">exist</span><span style="color:#808080;"><br />
</span><span style="color:#0000ff;">if</span><span style="color:#808080;"> </span><span style="color:#000000;">(</span><span style="color:#0000ff;">Test-Path</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$filename</span><span style="color:#000000;">)</span><span style="color:#808080;"> </span><span style="color:#000000;">{</span><span style="color:#808080;"><br />
</span><span style="color:#0000ff;">Remove-Item</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$filename</span><span style="color:#808080;"> </span><span style="color:#000000;">-force</span><span style="color:#808080;"><br />
</span><span style="color:#0000ff;">Write-Host</span><span style="color:#808080;"> &#8220;Found $filename existed, so I deleted it for you&#8221;<br />
</span><span style="color:#000000;">}</span><span style="color:#808080;"></p>
<p></span><span style="color:#2b91af;">$temp</span><span style="color:#808080;"> </span><span style="color:#000000;">|</span><span style="color:#808080;"> </span><span style="color:#0000ff;">Out-File</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$filename</span><span style="color:#808080;"><br />
</span><span style="color:#0000ff;">Get-Content</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$MyDefaultRDP</span><span style="color:#808080;"> </span><span style="color:#000000;">|</span><span style="color:#808080;"> </span><span style="color:#0000ff;">Out-File</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$filename</span><span style="color:#808080;"> </span><span style="color:#000000;">-Append</span><span style="color:#808080;"><br />
</span><span style="color:#0000ff;">Write-Host</span><span style="color:#808080;"> &#8220;$filename created&#8221;<br />
</span><span style="color:#000000;">}</span></p>
</div>
</blockquote>
<p>[Anyone know an easy way to format PowerShell code? This is the best I could get with Windows Live Writer Add-On.]</p>
<p>Ok so here are some examples of how you can use this:</p>
<p><a href="http://meltondba.files.wordpress.com/2011/07/new-rdp_examples.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="New-RDP_examples" src="http://meltondba.files.wordpress.com/2011/07/new-rdp_examples_thumb.jpg?w=910&#038;h=491" alt="New-RDP_examples" width="910" height="491" border="0" /></a></p>
<p>If you need to use an IP address for your server instead of the hostname:</p>
<p><a href="http://meltondba.files.wordpress.com/2011/07/new-rdp_exampleip.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="New-RDP_exampleIP" src="http://meltondba.files.wordpress.com/2011/07/new-rdp_exampleip_thumb.jpg?w=574&#038;h=359" alt="New-RDP_exampleIP" width="574" height="359" border="0" /></a></p>
<p>Then if you want to add your username:</p>
<p><a href="http://meltondba.files.wordpress.com/2011/07/new-rdp_examples1.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="New-RDP_examples1" src="http://meltondba.files.wordpress.com/2011/07/new-rdp_examples1_thumb.jpg?w=644&#038;h=404" alt="New-RDP_examples1" width="644" height="404" border="0" /></a></p>
<p>If you want to use a text file to pass a list of servers and different usernames I would suggest using a CSV file. Then work with the Import-Csv cmdlet to pass in each object to the right parameter.</p>
<p>Something like this should work for you (assume column headers in CSV file are Server and Username):</p>
<div class="code"><span style="color:#2b91af;">$servers</span><span style="color:#808080;"> </span><span style="color:#0000ff;">=</span><span style="color:#808080;"> </span><span style="color:#0000ff;">Import-Csv</span><span style="color:#808080;"> </span><span style="color:#000000;">.\Mylist.csv</span><span style="color:#808080;"><br />
</span><span style="color:#0000ff;">Foreach</span><span style="color:#000000;">(</span><span style="color:#2b91af;">$srv</span><span style="color:#808080;"> </span><span style="color:#000000;">in</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$servers</span><span style="color:#000000;">){</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">.\New-RDP.ps1</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$srv</span><span style="color:#000000;">.Server</span><span style="color:#808080;"> </span><span style="color:#000000;">.\MyDefault.rdp</span><span style="color:#808080;"> </span><span style="color:#2b91af;">$srv</span><span style="color:#000000;">.Username</span><span style="color:#808080;"><br />
</span><span style="color:#000000;">}</span></div>
<div class="code"></div>
<p><strong>NOTE:</strong> A small issue I have had running this script on my machine at home (Window 7 Ultimate) is the escape character “`n” (backtick + n) is supposed to add a new line before it writes the username text to the file. However it is not doing it when I run the script. If I have the $temp output to the console it shows the new line, but when it writes it to the file it does not for some reason. Which with the RDP file it does not matter as you can see in the screenshot above it still puts the username in the field. I don’t know if you will see the same problem, but wanted to let you know.</p>
<br /> Tagged: <a href='http://meltondba.wordpress.com/tag/powershell/'>PowerShell</a>, <a href='http://meltondba.wordpress.com/tag/rdp-file/'>RDP File</a>, <a href='http://meltondba.wordpress.com/tag/remote-desktop/'>Remote Desktop</a>, <a href='http://meltondba.wordpress.com/tag/shawn-melton/'>Shawn Melton</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltondba.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltondba.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltondba.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltondba.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltondba.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltondba.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltondba.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltondba.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltondba.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltondba.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltondba.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltondba.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltondba.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltondba.wordpress.com/394/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=394&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltondba.wordpress.com/2011/07/26/look-what-i-did-with-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dbf204269ac38e91e00d5a7add6067b9?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">meltondba</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2011/07/new-rdp_examples_thumb.jpg" medium="image">
			<media:title type="html">New-RDP_examples</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2011/07/new-rdp_exampleip_thumb.jpg" medium="image">
			<media:title type="html">New-RDP_exampleIP</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2011/07/new-rdp_examples1_thumb.jpg" medium="image">
			<media:title type="html">New-RDP_examples1</media:title>
		</media:content>
	</item>
		<item>
		<title>The rest of the story (PowerShell errors)</title>
		<link>http://meltondba.wordpress.com/2011/07/21/the-rest-of-the-story-powershell-errors/</link>
		<comments>http://meltondba.wordpress.com/2011/07/21/the-rest-of-the-story-powershell-errors/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 13:00:15 +0000</pubDate>
		<dc:creator>Shawn Melton</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://meltondba.wordpress.com/?p=375</guid>
		<description><![CDATA[So I got a new server given to me to check over. Unlike most folks I like to open up PowerShell to get quick fix on the configuration. I seem to have gotten used to using PowerShell enough now that it takes me about as much time to do it PowerShell as it would in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=375&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I got a new server given to me to check over. Unlike most folks I like to open up PowerShell to get quick fix on the configuration. I seem to have gotten used to using PowerShell enough now that it takes me about as much time to do it PowerShell as it would in SSMS. So I like hitting the keyboard more than I do clicking the mouse.</p>
<p>It is a Window Server 2008 box and SQL Server 2008 R2 so I know PowerShell is available to me for my perusing.</p>
<p>Open up PowerShell firing off a few commands as such:<br />
<code><br />
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.Smo') | Out-Null<br />
$s = New-Object 'Microsoft.SqlServer.Management.Smo.Server' MyInstance<br />
</code><br />
So good so far. I then go to check a few things to find out what the build number is and what the directory path is for the instance.<br />
<code><br />
$s.Information.version<br />
</code><br />
This will give you the Major, Minor, Build, and Revision information of that instance. It returns that no issue. However the next command returns nothing:<br />
<code><br />
$s.Information.RootDirectory<br />
</code><br />
What this should have given me is the path to the files for that instance on the server. The \MSSQL10_50.InstanceName\MSSQL\ path. However all it did was send me back to a prompt, without any output or error message. So I decided to just look at all of the information to see if it returned anything.<br />
<code><br />
$s.Information<br />
</code><br />
Which that line returns an error that looked like this:<br />
<code><br />
format-default : An exception occurred while executing a Transact-SQL statement or batch.<br />
+ CategoryInfo : NotSpecified: (:) [format-default], ExecutionFailureException<br />
+ FullyQualifiedErrorId : Microsoft.SqlServer.Management.Common.ExecutionFailureException,Microsoft...<br />
</code><br />
Which did not really help me, but I had an idea it had something to do with my permissions not being setup correctly. So I took that CategoryInfo line and popped it into the mighty <a href="http://en.wikipedia.org/wiki/Oracle_%28The_Matrix%29" target="_blank">Oracle</a> (aka Google). The first link that came up was a blog post from 2009 by Michiel Wories on <a href="http://blogs.msdn.com/b/mwories/archive/2009/06/08/powershell-tips-tricks-getting-more-detailed-error-information-from-powershell.aspx" target="_blank">how to get more detailed error information from PowerShell</a>. Which stemmed from a blog post Allen White (<a href="http://sqlblog.com/blogs/allen_white/default.aspx" target="_blank">b</a>|<a href="http://twitter.com/SQLRunr" target="_blank">t</a>) had written on actually how to <a href="http://sqlblog.com/blogs/allen_white/archive/2009/06/08/handling-errors-in-powershell.aspx" target="_blank">handle errors in PowerShell</a>.<br />
Apparently the message outputted to the console does not include all of the error. There is an &#8220;InnerException&#8221; that has all the meat of the error. To get that you can execute the command below. Now I believe you can only do this if you are working interactively with the console. If you are running a script you would need to check Allen&#8217;s post to see how you can capture the error itself when your script is executed.<br />
<code><br />
$error[0] | Format-List InnerException -Force<br />
</code><br />
From the output of this command I see the rest of the story:<br />
<code><br />
An exception occurred while executing a Transact-SQL statement or batch. ---&gt; The EXECUTE permission was denied on the ojbect 'xp_instance_regread', database 'mssqlsystemresource', schema 'sys'.<br />
The EXECUTE permissions was denied...on and on.<br />
</code><br />
Each object that should have been returned from executing <em>$s.Information</em> shows the &#8220;EXECUTE permission denied&#8221; message for that object. Which by itself is cool because you see what is happening in the background, and I now know what is being executed to return that information to me.</p>
<p>So now you know how to get to this information when you get an error in PowerShell that just may not give you enough info to go on. I am now off to get my permissions fixed.</p>
<br /> Tagged: <a href='http://meltondba.wordpress.com/tag/powershell/'>PowerShell</a>, <a href='http://meltondba.wordpress.com/tag/sql-server/'>SQL Server</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltondba.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltondba.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltondba.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltondba.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltondba.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltondba.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltondba.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltondba.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltondba.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltondba.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltondba.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltondba.wordpress.com/375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltondba.wordpress.com/375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltondba.wordpress.com/375/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=375&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltondba.wordpress.com/2011/07/21/the-rest-of-the-story-powershell-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dbf204269ac38e91e00d5a7add6067b9?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">meltondba</media:title>
		</media:content>
	</item>
		<item>
		<title>What OS permissions does SQL Server have?</title>
		<link>http://meltondba.wordpress.com/2011/04/28/what-os-permissions-does-sql-server-have/</link>
		<comments>http://meltondba.wordpress.com/2011/04/28/what-os-permissions-does-sql-server-have/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 14:00:59 +0000</pubDate>
		<dc:creator>Shawn Melton</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Notebook]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://meltondba.wordpress.com/?p=327</guid>
		<description><![CDATA[If you set the service account for the SQL Server services up at installation you are ahead of the game when dealing with securing your SQL Server installation. However there are some environments where the DBA does not do the initial installation of SQL Server. That requires the DBA to go back and configure a custom account [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=327&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_328" class="wp-caption alignleft" style="width: 171px"><a href="http://meltondba.files.wordpress.com/2011/04/multipledoors.jpg"><img class="size-full wp-image-328 " title="MultipleDoors" src="http://meltondba.files.wordpress.com/2011/04/multipledoors.jpg?w=630" alt=""   /></a><p class="wp-caption-text">Source: Flickr</p></div>
<p>If you set the service account for the SQL Server services up at installation you are ahead of the game when dealing with securing your SQL Server installation. However there are some environments where the DBA does not do the initial installation of SQL Server. That requires the DBA to go back and configure a custom account for the services after the installation.</p>
<p>In most instances if you use the SQL Server Configuration Manager (SSCM) to set the service account it should configure all the file, registry, and operating system permissions SQL Server needs for you. See this <a href="http://technet.microsoft.com/en-us/library/ms174212.aspx" target="_blank">TechNet article on SSCM</a>.</p>
<p>A question to ask is do you ever go back and periodically check to see what operating system permission the account was actually given? Do you check to make sure someone has not dorked around with the permissions and made your SQL Server instance not come back up at next reboot?</p>
<p>Well you can do this by opening up the group policy editor on the server and go through each <a href="http://msdn.microsoft.com/en-us/library/ms143504.aspx" target="_blank">permission SQL Server is supposed to have</a>. However, you would have to go through all of the OS permissions to make sure the service account has not been granted excessive permissions to the operating system.</p>
<p>Well who wants to use the GUI when we can use PowerShell!!! So here is a nice little one-liner I use to verify what permissions the SQL Server service account(s) have on a server:<br />
<code>Get-WMIObject -Namespace root\rsop\computer -Class RSOP_UserPrivilegeRight -Recurse | Where-Object {$_.AccountList -like "*SQL*"} | Format-Table UserRight -AutoSize</code></p>
<p>This portion of the code is where you will adjust it for your environment: &#8220;{$_.AccountList -like &#8220;*SQL*&#8221;}&#8221;. As written above this will return the permissions found to have an account name/group assigned to it that contains the text &#8220;SQL&#8221; within the name. Adjust this portion to your specific requirements.</p>
<p>This is a screenshot of what your output should resemble. (Do you see the excessive or un-needed privilege returned in the output?):<br />
<a href="http://meltondba.files.wordpress.com/2011/04/results.jpg"><img class="alignnone size-medium wp-image-333" title="results" src="http://meltondba.files.wordpress.com/2011/04/results.jpg?w=300&#038;h=64" alt="" width="300" height="64" /></a></p>
<p><strong><em>A little bit of a caveat for you on this code though is that it will only work on domain member servers. For some reason, that I never bothered to look up, the RSOP namespace is not available or accessible on stand-alone servers.</em></strong></p>
<br /> Tagged: <a href='http://meltondba.wordpress.com/tag/powershell/'>PowerShell</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltondba.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltondba.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltondba.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltondba.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltondba.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltondba.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltondba.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltondba.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltondba.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltondba.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltondba.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltondba.wordpress.com/327/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltondba.wordpress.com/327/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltondba.wordpress.com/327/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=327&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltondba.wordpress.com/2011/04/28/what-os-permissions-does-sql-server-have/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dbf204269ac38e91e00d5a7add6067b9?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">meltondba</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2011/04/multipledoors.jpg" medium="image">
			<media:title type="html">MultipleDoors</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2011/04/results.jpg?w=300" medium="image">
			<media:title type="html">results</media:title>
		</media:content>
	</item>
		<item>
		<title>Get those ACLs with PowerShell</title>
		<link>http://meltondba.wordpress.com/2011/04/21/get-those-acls-with-powershell/</link>
		<comments>http://meltondba.wordpress.com/2011/04/21/get-those-acls-with-powershell/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 18:31:55 +0000</pubDate>
		<dc:creator>Shawn Melton</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Notebook]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://meltondba.wordpress.com/?p=317</guid>
		<description><![CDATA[If I want to view the access permissions to a particular directory in Windows I can always go to the folder itself and check the security properties on the folder: But that is boring, lets use PowerShell!!! The cmdlet (commandlet) of choice for this is going to be: Get-Acl I will let you dive into this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=317&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If I want to view the access permissions to a particular directory in Windows I can always go to the folder itself and check the security properties on the folder:</p>
<p><img class="alignnone size-medium wp-image-318" title="SecurityTab" src="http://meltondba.files.wordpress.com/2011/04/securitytab.jpg?w=232&#038;h=300" alt="" width="232" height="300" /></p>
<p>But that is boring, lets use PowerShell!!!</p>
<p>The cmdlet (<em>commandlet</em>) of choice for this is going to be: <a href="http://technet.microsoft.com/en-us/library/dd347635.aspx" target="_blank">Get-Acl</a></p>
<p>I will let you dive into this command and try to figure it out, but this is the one-liner I use most often that gives me the information I want to know about the SQL Server directory:<br />
<code><br />
$a = (Get-Acl -Path 'D:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL')<br />
$a.Access | Select-Object FileSystemRights, AccessControlType, IdentityReference, IsInherited | ft -auto<br />
</code><br />
Here is a screenshot of the output:<br />
<a href="http://meltondba.files.wordpress.com/2011/04/folder_acl.jpg"><img src="http://meltondba.files.wordpress.com/2011/04/folder_acl.jpg?w=300&#038;h=50" alt="" title="Folder_ACL" width="300" height="50" class="alignnone size-medium wp-image-322" /></a></p>
<p>Now that is for a folder, what if I wanted to do it for a Registry hive as well? It works the same way with the exception of two things: (1) Your &#8220;Path&#8221; is changed to the registry hive of choice (HKLM, HKCU, etc) and (2) the &#8220;Select-Object&#8221; portion. Instead of &#8220;FileSystemRights&#8221; you would change that to &#8220;RegistryRights&#8221;, like so:<br />
<code><br />
$a = (Get-Acl -Path 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server')<br />
$a.Access | Select-Object RegistryRights, AccessControlType, IdentityReference, IsInherited | ft -auto<br />
</code><br />
Here is screenshot of the output:<br />
<a href="http://meltondba.files.wordpress.com/2011/04/hklm_acl1.jpg"><img src="http://meltondba.files.wordpress.com/2011/04/hklm_acl1.jpg?w=300&#038;h=55" alt="" title="HKLM_ACL" width="300" height="55" class="alignnone size-medium wp-image-323" /></a></p>
<br /> Tagged: <a href='http://meltondba.wordpress.com/tag/powershell/'>PowerShell</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltondba.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltondba.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltondba.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltondba.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltondba.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltondba.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltondba.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltondba.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltondba.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltondba.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltondba.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltondba.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltondba.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltondba.wordpress.com/317/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=317&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltondba.wordpress.com/2011/04/21/get-those-acls-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dbf204269ac38e91e00d5a7add6067b9?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">meltondba</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2011/04/securitytab.jpg?w=232" medium="image">
			<media:title type="html">SecurityTab</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2011/04/folder_acl.jpg?w=300" medium="image">
			<media:title type="html">Folder_ACL</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2011/04/hklm_acl1.jpg?w=300" medium="image">
			<media:title type="html">HKLM_ACL</media:title>
		</media:content>
	</item>
		<item>
		<title>Books I get to read. (E-Books)</title>
		<link>http://meltondba.wordpress.com/2011/01/27/books-i-get-to-read-e-books/</link>
		<comments>http://meltondba.wordpress.com/2011/01/27/books-i-get-to-read-e-books/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 04:07:35 +0000</pubDate>
		<dc:creator>Shawn Melton</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Apress]]></category>
		<category><![CDATA[ebooks]]></category>
		<category><![CDATA[Oreilly]]></category>
		<category><![CDATA[reading]]></category>

		<guid isPermaLink="false">https://meltondba.wordpress.com/2011/01/27/books-i-have-to-read-e-books/</guid>
		<description><![CDATA[I thought I would share some of the E-books I have purchased recently. I did not like them to begin with but have an iPod Touch now and it is not too bad reading on it. It just depends on what format it is in. I found a free app to read PDF files and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=288&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I thought I would share some of the E-books I have purchased recently. I did not like them to begin with but have an iPod Touch now and it is not too bad reading on it. It just depends on what format it is in. I found a free app to read PDF files and I use <a href="http://www.lexcycle.com/" target="_blank">Stanza</a> to read ePub files. Reading ePub files is much easier than trying to read the PDFs. With ePub files the reader application formats the text to the screen, versus the PDF is zoom in and move the page around to get all the text. I don’t usually catch myself reading the PDF formatted E-books all that much.</p>
<p>If you don’t already, you really should be following O’Reilly on <a href="http://twitter.com/oreillymedia" target="_blank">Twitter</a> and/or <a href="http://www.facebook.com/OReilly" target="_blank">Facebook</a>. You will get notified through one of these about daily deals for e-books at 50% off or more. I have gotten some great deals on some good book titles. The following are the ones I have gotten in the past months from O’Reilly .</p>
<ul>
<li>
<h4><a href="http://oreilly.com/catalog/9780735626249" target="_blank">Microsoft® SQL Server® 2008 Internals</a></h4>
</li>
<li>
<h4><a href="http://oreilly.com/catalog/9780735626010" target="_blank">Microsoft® SQL Server® 2008 T-SQL Fundamentals</a></h4>
</li>
<li>
<h4><a href="http://oreilly.com/catalog/9780735625952" target="_blank">Windows PowerShell™ 2.0 Administrators Pocket Consultant</a></h4>
</li>
</ul>
<p>Apress also does deals, called “Deal of the Day”. However I have not noticed they do any advertising of this through Twitter or Facebook. Apress offers 1 book for a 24 hour period for $10. I caught a post on Twitter the other day about the title for that day and was able to snag this title from them:</p>
<ul>
<li>
<h4><a href="http://www.apress.com/book/view/9781430229100" target="_blank">Pro SQL Server 2008 Policy-Based Management</a></h4>
</li>
</ul>
<p>The downside to Apress is they only offer E-books in PDF format. I don’t know if they have future plans to offer in other formats or not. O’Reilly on the other hand, offers the book in APK (Android), DAISY (Text-to-Speech for those with print disabilities), ePub (E-Reader apps for Apple devices) , Mobi (Amazon Kindle), and PDF. You see why I like them much more? I can see the advantage to the E-book and having the physical book. However I find myself now more likely to read from my iPod that I do sitting somewhere to pull out the physical book. I will re-read them on the computer as well.&lt;/P? </p>
<br /> Tagged: <a href='http://meltondba.wordpress.com/tag/apress/'>Apress</a>, <a href='http://meltondba.wordpress.com/tag/ebooks/'>ebooks</a>, <a href='http://meltondba.wordpress.com/tag/oreilly/'>Oreilly</a>, <a href='http://meltondba.wordpress.com/tag/reading/'>reading</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltondba.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltondba.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltondba.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltondba.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltondba.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltondba.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltondba.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltondba.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltondba.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltondba.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltondba.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltondba.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltondba.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltondba.wordpress.com/288/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=288&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltondba.wordpress.com/2011/01/27/books-i-get-to-read-e-books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dbf204269ac38e91e00d5a7add6067b9?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">meltondba</media:title>
		</media:content>
	</item>
		<item>
		<title>Training for the Master from the Masters</title>
		<link>http://meltondba.wordpress.com/2011/01/21/training-for-the-master-from-the-masters/</link>
		<comments>http://meltondba.wordpress.com/2011/01/21/training-for-the-master-from-the-masters/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 06:54:23 +0000</pubDate>
		<dc:creator>Shawn Melton</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Master]]></category>
		<category><![CDATA[SQLskills]]></category>
		<category><![CDATA[training]]></category>

		<guid isPermaLink="false">https://meltondba.wordpress.com/2011/01/21/training-for-the-master-from-the-masters/</guid>
		<description><![CDATA[(Bottom left corner of this photo you’ll see the nose of the sniper) A talent and a gift, what is the difference? I follow the definition that a talent is something you learn and a gift is something you were born with. I believe one of my gifts is helping people, or sometimes called the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=285&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://www.flickr.com/photos/twotadpoles/2344836391/" target="_blank"><img style="background-image:none;padding-left:0;padding-right:0;display:block;float:none;margin-left:auto;margin-right:auto;padding-top:0;border-width:0;" title="Sniper" border="0" alt="Sniper" src="http://meltondba.files.wordpress.com/2011/01/sniper.jpg?w=244&#038;h=164" width="244" height="164" /></a><font size="2" face="Arial Narrow">(Bottom left corner of this photo you’ll see the nose of the sniper) </font></p>
<p>A talent and a gift, what is the difference? I follow the definition that a talent is something you learn and a gift is something you were born with. </p>
<p>I believe one of my gifts is helping people, or sometimes called the gift of service. I enjoy offering myself as a service to people whether it be helping them move some furniture or fixing that virus on their computer. Regarding technology, I like watching someone have that moment of “ah now I get it” if I am showing them how to use a program or how something works. (I got great enjoyment showing my, at the time 4 year old, how to use the mouse on our computer. Now he can play PBS and Nick JR games online by himself.) </p>
<p>I have a few talents, one of them being knowledge of SQL Server. I take pride in the fact that most of what I know with SQL Server I have learned on my own. I follow many folks in the SQL Server community reading blogs and books. I have also being blessed with employment that has given me the opportunity to interact with SQL Server itself. The only formal training I ever had was a beta course on upgrading my skills to SQL Server 2005. I got a little from that class but not much.</p>
<p>A downside to this talent…learning it on my own. It is a lonely thing to learn alone without a study partner or even my very own <a href="http://www.sqlservercentral.com/blogs/johnsansom/archive/2011/01/18/why-every-dba-needs-a-buddy.aspx" target="_blank">SQL Buddy</a>. I work with other DBAs in my current job but get the feeling most of them are SQL Server while they are at work, but after work “what is SQL Server?”. (I don’t know this for sure of everyone but it is just not an environment that encourages advancing their knowledge to much on a particular product.)</p>
<p>Now if I was to say <a href="http://www.sqlskills.com/BLOGS/PAUL/post/Master_Immersion_Event_Competition.aspx" target="_blank">win a contest</a> to get a free seat at the <a href="http://www.sqlskills.com/Master1-Dallas-20110221.asp" target="_blank">SQLskills Master Immersion Event in Dallas, TX</a>…well I would kiss a sheep square on the mouth. </p>
<p>As it states on the <a href="http://www.sqlskills.com/Master1-Dallas-20110221.asp" target="_blank">class details page</a>:</p>
<blockquote><p>The more you know about how SQL Server works the easier you will be able to respond to performance, design, and corruption problems &#8211; as well as solve them!</p>
</blockquote>
<p>I sit and watch webcast and read blog post from folks in the SQL Server community that are considered to be (and are) experts in their field. I read and watch them explain features about SQL Server and why “this” or “this” happens and what SQL Server is doing. I would love to have that depth of knowledge and talent to be able to share with folks. That is a level I would love to attain.</p>
<p>I would greatly enjoy the opportunity to <a href="http://www.sqlskills.com/BLOGS/KIMBERLY/post/Do-I-need-to-be-a-master-for-master-immersion-events.aspx" target="_blank">master my SQLskills and immerse myself in SQL Server</a> more by attending this course. To get the core fundamentals and foundation of SQL Server I believe would help me start anew learning SQL Server. Ensuring I have a good base/foundation of SQL Server knowledge to build upon will put me in a better position to advance to that master level. I think having this knowledge will be two fold: </p>
<ol>
<li>
<p>Learning how it actually works versus how I think it works will improve my confidence level in so many ways (troubleshooting issues, speaking with people, or writing about SQL Server). It will very possibly help me get past that hump to submit an abstract for a <a href="http://www.sqlsaturday.com/" target="_blank">SQL Saturday</a> or SQL PASS user group somewhere. </p>
</li>
<li>
<p>I also firmly believe getting taught to this level will help train myself on how to learn more about SQL Server. The resources and contacts/friendships that can be made having a week long class with people allow me to expand my network in the SQL Server community. It will allow me to feed off their strengths, and along the way maybe I will end up helping them with their weaknesses. Getting those contacts and that amount of knowledge is priceless and can be the key to getting more involved in the SQL Server community.</p>
</li>
<p> I expect if I am able to win that free seat that there will be many, many moments of “AH! that’s how it works”. I would love to experience that. </ol>
<br /> Tagged: <a href='http://meltondba.wordpress.com/tag/master/'>Master</a>, <a href='http://meltondba.wordpress.com/tag/sqlskills/'>SQLskills</a>, <a href='http://meltondba.wordpress.com/tag/training/'>training</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/meltondba.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/meltondba.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/meltondba.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/meltondba.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/meltondba.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/meltondba.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/meltondba.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/meltondba.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/meltondba.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/meltondba.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/meltondba.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/meltondba.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/meltondba.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/meltondba.wordpress.com/285/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=meltondba.wordpress.com&amp;blog=13139315&amp;post=285&amp;subd=meltondba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://meltondba.wordpress.com/2011/01/21/training-for-the-master-from-the-masters/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/dbf204269ac38e91e00d5a7add6067b9?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">meltondba</media:title>
		</media:content>

		<media:content url="http://meltondba.files.wordpress.com/2011/01/sniper.jpg" medium="image">
			<media:title type="html">Sniper</media:title>
		</media:content>
	</item>
	</channel>
</rss>
