<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/2.4.5" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>LessThanDot - All Blogs - Author(s): 9</title>
		<link>http://blogs.lessthandot.com/index.php/All/</link>
		<description></description>
		<language>en-GB</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=2.4.5"/>
		<ttl>60</ttl>
				<item>
			<title>Resources for Professional Development</title>
			<link>http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development</link>
			<pubDate>Thu, 22 Jul 2010 22:36:24 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="main">Professional Development</category>			<guid isPermaLink="false">906@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Waiting for your company to provide training courses or advancement opportunities? It might be a long wait. Unfortunately many companies overlook professional development or consistently sacrifice it when the first round of annual budget cuts occur. Even when we do get training opportunities, many of us continue to select classes at random, based on what seems interesting at the moment.&lt;/p&gt;

&lt;p&gt;We live in a field that is expanding daily, where the environment we work in is drastically different from what it was 5 years ago and from what it will be 5 years from now. Whether we plan on being in a different role or not, advancing our skills and staying in step with the market is a must.&lt;/p&gt;

&lt;p&gt;This post covers a number of helpful links and ideas for staying up to date in our field.&lt;/p&gt;

&lt;h2&gt;Development Plans&lt;/h2&gt;
&lt;p&gt;Creating a development plan can help provide focus and give us a measure of our progress. These articles provide additional information on creating and refining our plans:&lt;/p&gt;
&lt;ul style=&quot;margin: 1em 2em;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.informit.com/guides/content.aspx?g=sqlserver&amp;amp;seqNum=356&quot; title=&quot;Read SQL Server Professional Development Plan, Part 1&quot;&gt;SQL Server Professional Development Plan, Part 1&lt;/a&gt; and &lt;a href=&quot;http://www.informit.com/guides/content.aspx?g=sqlserver&amp;amp;seqNum=357&quot; title=&quot;Read SQL Server Professional Development Plan, Part 2&quot;&gt;Part 2&lt;/a&gt; by Buck Woody (&lt;a href=&quot;http://blogs.msdn.com/b/buckwoody/&quot; title=&quot;Buck Woody's blog&quot;&gt;blog&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/buckwoody&quot; title=&quot;Buck Woody on twitter&quot;&gt;twitter&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.greatleadershipbydan.com/2008/11/how-to-write-great-individual.html&quot; title=&quot;Read How to Write a Great Individual Development Plan (IDP)&quot;&gt;How to Write a Great Individual Development Plan (IDP)&lt;/a&gt; and a great &lt;a href=&quot;http://www.greatleadershipbydan.com/2008/04/checklist-for-great-individual.html&quot; title=&quot;Read Checklist for Great Individual&quot;&gt;checklist&lt;/a&gt; by Dan McCarthy (&lt;a href=&quot;http://www.greatleadershipbydan.com/&quot; title=&quot;Great Leadership blog by Dan McCarthy&quot;&gt;blog&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/greatleadership&quot; title=&quot;Dan McCarthy on Twitter&quot;&gt;twitter&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facility9.com/2009/09/14/your-own-personal-development-plan&quot; title=&quot;Read Your Own Personal Development Plan&quot;&gt;Your Own Personal Development Plan&lt;/a&gt; by Jeremiah Peschka (&lt;a href=&quot;http://facility9.com/&quot; title=&quot;facility9 blog&quot;&gt;blog&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/peschkaj&quot; title=&quot;Jeremiah on Twitter&quot;&gt;twitter&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Tools and Processes&lt;/h2&gt;
&lt;p&gt;Once we have a plan, we need to be able to execute it. Having tools to help us execute the plan, methods of communicating the plan, and tricks for finding time can all help us be successful. &lt;/p&gt;
&lt;ul style=&quot;margin: 1em 2em;&quot;&gt;
&lt;li&gt;The &lt;a href=&quot;http://personalkanban.com/personal-kanban-101/&quot; title=&quot;More information on Personal Kanban&quot;&gt;Personal Kanban&lt;/a&gt; site has a lot of good information on creating a visual board and process to help manage short and long term tasks&lt;/li&gt;
&lt;li&gt;Jes Borland (&lt;a href=&quot;http://jesborland.wordpress.com/&quot; title=&quot;Jes Borland's blog&quot;&gt;blog&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/grrl_geek&quot; title=&quot;Jes Borland on Twitter&quot;&gt;twitter&lt;/a&gt;) helps track her progress by reporting a &lt;a href=&quot;http://jesborland.wordpress.com/2010/07/08/2010-quarter-2-goal-review/&quot; title=&quot;2010 Quarter 2 Goal Review by Jes Borland&quot;&gt;Quarterly Status&lt;/a&gt; to her friends and the wider community&lt;/li&gt;
&lt;li&gt;And &lt;a href=&quot;http://www.openforum.com/idea-hub/topics/lifestyle/article/80-ways-to-steal-valuable-minutes-for-your-work-day-glen-stansberry&quot; title=&quot;Read 80 Ways to Steal Valuable Minutes for Your Work Day&quot;&gt;American Express's OPEN Forum &lt;/a&gt; has a number of ideas on where we can find time to execute&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Free and Cheap Resources&lt;/h2&gt;
&lt;p&gt;Not all development costs money. My own plan includes a certain amount of blog writing (free), reading a certain number of articles each week (free), an ongoing effort to keep up to date with webinars and webcasts (free), and attendance (and beginning to speak) at user groups and events (the free kind).&lt;/p&gt;

&lt;p&gt;I can't afford Tech-Ed or the PASS Summit, but I can afford:&lt;/p&gt;
&lt;ul style=&quot;margin: 1em 2em;&quot;&gt;
	&lt;li&gt;Watching the &lt;a href=&quot;http://www.msteched.com/&quot; title=&quot;Watch recorded Tech-Ed sessions&quot;&gt;recorded Tech-Ed sessions&lt;/a&gt; for free at MSDN (I've had over &lt;a href=&quot;http://delicious.com/tarwn/tech-ed&quot; title=&quot;Eli's Tech-Ed Delicious bookmarks&quot;&gt;11 hours&lt;/a&gt; of free training so far)&lt;/li&gt;
	&lt;li&gt;Watching the &lt;a href=&quot;http://www.sqlpass.org/LearningCenter/SummitOnDemand/Summit2008.aspx&quot; title=&quot;2008 PASS Summmit recordings&quot;&gt;2008 PASS Summit recordings&lt;/a&gt; for free (requires login)&lt;/li&gt;
	&lt;li&gt;Catching free &lt;a href=&quot;https://msevents.microsoft.com/CUI/default.aspx?culture=en-US&quot; title=&quot;Microsoft Events Home&quot;&gt;live and recorded webcasts&lt;/a&gt; from Microsoft&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Plus there are events like &lt;a href=&quot;http://www.sqlsaturday.com/&quot; title=&quot;SQLSaturday website&quot;&gt;SQLSaturday&lt;/a&gt;, &lt;a href=&quot;http://www.google.com/search?q=code+camp&quot; title=&quot;Search for Code Camps&quot;&gt;Code Camps&lt;/a&gt;, and user groups galore that don't cost $1000's to attend.&lt;/p&gt;

&lt;p&gt;If you need more ideas, Ted (&lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?summary.php?author=68&quot; title=&quot;Ted's blog posts&quot;&gt;blog&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/onpnt&quot; title=&quot;Ted on Twitter&quot;&gt;twitter&lt;/a&gt;) posted an article with more SQL Resources &lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/EthicsIT/sql-help-and-resources&quot; title=&quot;SQL Community Services - Resources everywhere!&quot;&gt;here&lt;/a&gt; and I presented a list of ideas in &lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-1&quot; title=&quot;Read Part 1 of the &quot;There is Never Time For...&quot; series&quot;&gt;Part 1&lt;/a&gt; of the &quot;There is Never Time For...&quot; series.&lt;/p&gt;

&lt;p&gt;Have more ideas or links for resources? Add them to the comments below. I'm always on the lookout for more ideas and I'm sure others would appreciate them as well.&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<p>Waiting for your company to provide training courses or advancement opportunities? It might be a long wait. Unfortunately many companies overlook professional development or consistently sacrifice it when the first round of annual budget cuts occur. Even when we do get training opportunities, many of us continue to select classes at random, based on what seems interesting at the moment.</p>

<p>We live in a field that is expanding daily, where the environment we work in is drastically different from what it was 5 years ago and from what it will be 5 years from now. Whether we plan on being in a different role or not, advancing our skills and staying in step with the market is a must.</p>

<p>This post covers a number of helpful links and ideas for staying up to date in our field.</p>

<h2>Development Plans</h2>
<p>Creating a development plan can help provide focus and give us a measure of our progress. These articles provide additional information on creating and refining our plans:</p>
<ul style="margin: 1em 2em;">
<li><a href="http://www.informit.com/guides/content.aspx?g=sqlserver&amp;seqNum=356" title="Read SQL Server Professional Development Plan, Part 1">SQL Server Professional Development Plan, Part 1</a> and <a href="http://www.informit.com/guides/content.aspx?g=sqlserver&amp;seqNum=357" title="Read SQL Server Professional Development Plan, Part 2">Part 2</a> by Buck Woody (<a href="http://blogs.msdn.com/b/buckwoody/" title="Buck Woody's blog">blog</a> | <a href="http://twitter.com/buckwoody" title="Buck Woody on twitter">twitter</a>)</li>
<li><a href="http://www.greatleadershipbydan.com/2008/11/how-to-write-great-individual.html" title="Read How to Write a Great Individual Development Plan (IDP)">How to Write a Great Individual Development Plan (IDP)</a> and a great <a href="http://www.greatleadershipbydan.com/2008/04/checklist-for-great-individual.html" title="Read Checklist for Great Individual">checklist</a> by Dan McCarthy (<a href="http://www.greatleadershipbydan.com/" title="Great Leadership blog by Dan McCarthy">blog</a> | <a href="http://twitter.com/greatleadership" title="Dan McCarthy on Twitter">twitter</a>)</li>
<li><a href="http://facility9.com/2009/09/14/your-own-personal-development-plan" title="Read Your Own Personal Development Plan">Your Own Personal Development Plan</a> by Jeremiah Peschka (<a href="http://facility9.com/" title="facility9 blog">blog</a> | <a href="http://twitter.com/peschkaj" title="Jeremiah on Twitter">twitter</a>)</li>
</ul>

<h2>Tools and Processes</h2>
<p>Once we have a plan, we need to be able to execute it. Having tools to help us execute the plan, methods of communicating the plan, and tricks for finding time can all help us be successful. </p>
<ul style="margin: 1em 2em;">
<li>The <a href="http://personalkanban.com/personal-kanban-101/" title="More information on Personal Kanban">Personal Kanban</a> site has a lot of good information on creating a visual board and process to help manage short and long term tasks</li>
<li>Jes Borland (<a href="http://jesborland.wordpress.com/" title="Jes Borland's blog">blog</a> | <a href="http://twitter.com/grrl_geek" title="Jes Borland on Twitter">twitter</a>) helps track her progress by reporting a <a href="http://jesborland.wordpress.com/2010/07/08/2010-quarter-2-goal-review/" title="2010 Quarter 2 Goal Review by Jes Borland">Quarterly Status</a> to her friends and the wider community</li>
<li>And <a href="http://www.openforum.com/idea-hub/topics/lifestyle/article/80-ways-to-steal-valuable-minutes-for-your-work-day-glen-stansberry" title="Read 80 Ways to Steal Valuable Minutes for Your Work Day">American Express's OPEN Forum </a> has a number of ideas on where we can find time to execute</li>
</ul>

<h2>Free and Cheap Resources</h2>
<p>Not all development costs money. My own plan includes a certain amount of blog writing (free), reading a certain number of articles each week (free), an ongoing effort to keep up to date with webinars and webcasts (free), and attendance (and beginning to speak) at user groups and events (the free kind).</p>

<p>I can't afford Tech-Ed or the PASS Summit, but I can afford:</p>
<ul style="margin: 1em 2em;">
	<li>Watching the <a href="http://www.msteched.com/" title="Watch recorded Tech-Ed sessions">recorded Tech-Ed sessions</a> for free at MSDN (I've had over <a href="http://delicious.com/tarwn/tech-ed" title="Eli's Tech-Ed Delicious bookmarks">11 hours</a> of free training so far)</li>
	<li>Watching the <a href="http://www.sqlpass.org/LearningCenter/SummitOnDemand/Summit2008.aspx" title="2008 PASS Summmit recordings">2008 PASS Summit recordings</a> for free (requires login)</li>
	<li>Catching free <a href="https://msevents.microsoft.com/CUI/default.aspx?culture=en-US" title="Microsoft Events Home">live and recorded webcasts</a> from Microsoft</li>
</ul>

<p>Plus there are events like <a href="http://www.sqlsaturday.com/" title="SQLSaturday website">SQLSaturday</a>, <a href="http://www.google.com/search?q=code+camp" title="Search for Code Camps">Code Camps</a>, and user groups galore that don't cost $1000's to attend.</p>

<p>If you need more ideas, Ted (<a href="http://blogs.lessthandot.com/index.php/All/?summary.php?author=68" title="Ted's blog posts">blog</a> | <a href="http://twitter.com/onpnt" title="Ted on Twitter">twitter</a>) posted an article with more SQL Resources <a href="http://blogs.lessthandot.com/index.php/ITProfessionals/EthicsIT/sql-help-and-resources" title="SQL Community Services - Resources everywhere!">here</a> and I presented a list of ideas in <a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-1" title="Read Part 1 of the "There is Never Time For..." series">Part 1</a> of the "There is Never Time For..." series.</p>

<p>Have more ideas or links for resources? Add them to the comments below. I'm always on the lookout for more ideas and I'm sure others would appreciate them as well.</p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development#comments</comments>
		</item>
				<item>
			<title>Model-View-Presenter: Looking at Passive View</title>
			<link>http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/model-view-presenter-looking-at-passive</link>
			<pubDate>Thu, 15 Jul 2010 11:44:12 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="main">Designing Software</category>
<category domain="alt">Introduction to Architecture &amp; Design</category>			<guid isPermaLink="false">889@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Model-View-Presenter is an architecture pattern that defines a structure for behavior and logic at the UI level. M-V-P separates the logic of the presentation, such as interacting with back-end services and the business layer, from the mechanics of displaying buttons and interface components. &lt;/p&gt;

&lt;p&gt;I often build small projects to help understand and grow my skills as a developer, architect, and all-around technologist (as may be apparent from the &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot; target=&quot;_blank&quot; title=&quot;See all of my posts at LTD&quot;&gt;wide range of topics I post on&lt;/a&gt;). Today I worked with a combination of Visio and Visual Studio to build a sample project to play with the Passive View concept and to help grow my own understanding of the concept. This post will cover the Visio side of my learning-curve.&lt;/p&gt;

&lt;p&gt;You can read more about Model View Presenter at &lt;a href=&quot;http://en.wikipedia.org/wiki/Model-view-presenter&quot; target=&quot;_blank&quot; title=&quot;Model-View-Presenter at Wikipedia&quot;&gt;Wikipedia&lt;/a&gt; and &lt;a href=http://msdn.microsoft.com/en-us/magazine/cc188690.aspx&quot;&quot; target=&quot;_blank&quot; title=&quot;Model View Presenter by Jean-Paul Boodhoo on MSDN&quot;&gt;MSDN&lt;/a&gt;. Perhaps the best information can be found on Martin Fowler's site, where he has separate write-ups on &lt;a href=&quot;http://www.martinfowler.com/eaaDev/PassiveScreen.html&quot; target=_blank&quot; title=&quot;Passive View pattern&quot;&gt;Passive View&lt;/a&gt; and &lt;a href=&quot;http://www.martinfowler.com/eaaDev/SupervisingPresenter.html&quot; target=_blank&quot; title=&quot;Supervising Controller Pattern&quot;&gt;Supervising Controller&lt;/a&gt;.&lt;/p&gt;

&lt;div style=&quot;background-color:#FFFFCC; padding: .5em; margin: .5em; border: 1px solid #DDDDAA; color: #333333; font-size: 80%;&quot;&gt;Note: I know some people were waiting for another Virtual Lab entry this week, and here I am writing about Architecture instead. Don't worry, the virtual lab series will continue, I just felt like doing a write-up while I was playing this past weekend.&lt;/div&gt;

&lt;h2&gt;Passive View&lt;/h2&gt;
&lt;p&gt;Passive View is a subset of the Model-View-Presenter pattern. In Passive View, the interface is responsible for handling interface-specific logic, such as figuring out how to put a value in a textbox or react to events from button clicks, but all actions and logic outside of the raw UI are sent to the Presenter to execute or manage. The Presenter is responsible for calling business methods in the Business model and updating the data that is available in the View. &lt;/p&gt;

&lt;div style=&quot;text-align: center; font-size: .8em; color: #666666;&quot;&gt;
&lt;img src=&quot;http://tiernok.com/LTDBlog/MVP/mvp.png&quot; alt=&quot;Basic Model-View-Presenter diagram&quot; /&gt;&lt;br /&gt;
Basic Model-View-Presenter Diagram
&lt;/div&gt;

&lt;p&gt;From the outside in, the architecture for Passive View looks something like this:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;UI - The User Interface reflects what is going on beneath it by implementing one or more View interfaces&lt;/li&gt;
	&lt;li&gt;Presenter - The Presenter receives interactions from the UI or Model and updates the Views it is attached to&lt;/li&gt;
	&lt;li&gt;Model - The model is a facade or black box in our diagram, behind which is a business logic layer and data layer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a flat architecture we would collect data from the interface, perhaps do some business and data validation, and then save it directly to a database using stored procedures or inline SQL. Defining a data access layer (or data model like entity framework) allows our application to operate on cohesive, defined objects that are meaningful to the application and stored and retrieved consistently. Defining a business logic layer allows us to centralize business rules that operate on entities in our application in a manner that is consistent with the business and internally consistent in the application, minimizing the risk that occurs when making changes to the business flow. Separating the logic of populating inputs and responding to button presses on the UI from the information being communicated to the end user and conceptual responses to their input allows the system to interact with the user consistently across any number of interfaces into the same application.&lt;/p&gt;

&lt;p&gt;The definition of each level increases our ability to automate testing and supports greater &lt;a href=&quot;http://en.wikipedia.org/wiki/Separation_of_concerns&quot; title=&quot;Separation of Concerns at Wikipedia&quot; target=&quot;_blank&quot;&gt;Separation of Concerns&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Implementing a Sample Project&lt;/h2&gt;
&lt;p&gt;My learning exercise has been the the creation of an ASP.Net search page that allows an end user (customer) to search for finished products from the AdventureWorks sample database. The architecture and design decisions were done as an exercise in Visio using simple shapes and layouts.&lt;/p&gt;

&lt;p&gt;My example application has several functional and non-functional requirements:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Functional - Display product number, name, list price, and available quantity in tabular format&lt;/li&gt;
	&lt;li&gt;Functional - Provide a basic search input and button to search product names&lt;/li&gt;
	&lt;li&gt;Non-Functional - Implement an M-V-P pattern - Obviously the purpose of this whole exercise&lt;/li&gt;
	&lt;li&gt;Non-Functional - Use a simple model stack that can be easily replaced with a Service-Oriented one at a later time&lt;/li&gt;
	&lt;li&gt;Non-Functional - Build with the idea that we will later create a Silverlight or WPF front-end&lt;/li&gt;
	&lt;li&gt;Non-Functional - Make pretty pictures for article&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;i&gt;My unwritten, final requirement was to finish the whole thing in half a day, though luckily I didn't define whether I intended that to mean 4 hours or 12.&lt;/i&gt;&lt;/p&gt;

&lt;h3&gt;Initial Architecture&lt;/h3&gt;
&lt;p&gt;To start I created a diagram of the application architecture:&lt;/p&gt;
&lt;div style=&quot;text-align: center; font-size: .8em; color: #666666;&quot;&gt;
&lt;img src=&quot;http://tiernok.com/LTDBlog/MVP/mvp_arch_01.png&quot; alt=&quot;More extensive M-V-P Diagram&quot; /&gt;&lt;br /&gt;
More Extensive Model-View-Presenter Diagram
&lt;/div&gt;
&lt;p&gt;The purple layer is my presentation layer, which reflects the View. The blue layer is my Presenter layer which contains the logic for interacting between the end user and interface as well as a definition, or contract, of the information available in the View. The Green is the Model (or is behind the model, depending on your viewpoint) and exposes business functions and data entities for the Presenter to interact with.&lt;/p&gt;

&lt;h3&gt;Class Layout&lt;/h3&gt;
&lt;p&gt;Once the high level diagram was completed, I could approach the task of creating some base classes and interfaces to use in implementing the project.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Model.IModel - Generic Model Interface to expose business calls to Presenters&lt;/li&gt;
	&lt;li&gt;Presenter.IView - Generic View Interface that all Presenters can interact with and all screens implement&lt;/li&gt;
	&lt;li&gt;Presenter.BasePresenter - Generic Presenter class that all Presenters will implement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To keep the project to a single morning but also allow the ability to come back and build a more architecturally sound solution, I implemented the Model in a very basic fashion that was referenced locally by the Presenter project and makes direct calls to SQL Server using ADO and parametrized, inline SQL. This buys me the benefits of having a well-defined Model (via the interface) but allows me concentrate my time and effort on the learning part of the project (ie, the M-V-P interaction and structure). Defining the model interface also leaves me open to come back and replace it with better separated code and the ability to create a model that acts as a facade to a service stack, instead of local DLLs.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Model.BasicModel.Model - Basic implementation of a model that will interact with AdventureWorks on SQL Server&lt;/li&gt;
	&lt;li&gt;Model.Entities.Product - A Product Entity that can be communicated between an IModel instance and Presenter&lt;br /&gt;
	&lt;li&gt;Presenter.ProductSearchPresenter - A Presenter to manage product search interface&lt;/li&gt;
	&lt;li&gt;Presenter.IProductSearchView - A view of the data involved in a product search&lt;/li&gt;
	&lt;li&gt;ProductSearch.aspx - A web page that implements the IProductSearchView and interacts with the ProductSearchPresenter&lt;/li&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;My final Visio diagram ended up looking like this:&lt;/p&gt;
&lt;div style=&quot;text-align: center; font-size: .8em; color: #666666;&quot;&gt;
&lt;img src=&quot;http://tiernok.com/LTDBlog/MVP/mvp_arch_02.png&quot; alt=&quot;Example Application Diagram&quot; /&gt;&lt;br /&gt;
Diagram of Example Application
&lt;/div&gt;

&lt;p&gt;In this case the left side represents basic components (bases classes and interfaces) that are used to define common structure or contracts on the right side. &lt;/p&gt;

&lt;h2&gt;The Code&lt;/h2&gt;
&lt;p&gt;For the purposes of the example project, my view has properties for Search Text, a Search Count (number of results), Results (a generic list of the Product entity), and a boolean indicating whether there are results to display. My Web Form implements these properties, tying them to elements on the screen.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;csharp&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;csharp&quot; id=&quot;cb56980&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;public&lt;/span&gt; partial &lt;span style=&quot;color: #FF0000;&quot;&gt;class&lt;/span&gt; WebForm1 : &lt;span style=&quot;color: #000000;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Web&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;UI&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Page&lt;/span&gt;, Presenter.&lt;span style=&quot;color: #0000FF;&quot;&gt;Views&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;IProductSearchView&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Presenter.&lt;span style=&quot;color: #0000FF;&quot;&gt;ProductSearchPresenter&lt;/span&gt; _presenter;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;void&lt;/span&gt; Page_Load&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;object&lt;/span&gt; sender, EventArgs e&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; btnSearch.&lt;span style=&quot;color: #0000FF;&quot;&gt;Click&lt;/span&gt; += &lt;a href=&quot;http://www.google.com/search?q=new+msdn.microsoft.com&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;new&lt;/span&gt;&lt;/a&gt; EventHandler&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;btnSearch_Click&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rptProducts.&lt;span style=&quot;color: #0000FF;&quot;&gt;ItemDataBound&lt;/span&gt; += &lt;a href=&quot;http://www.google.com/search?q=new+msdn.microsoft.com&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;new&lt;/span&gt;&lt;/a&gt; RepeaterItemEventHandler&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;rptProducts_ItemDataBound&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _presenter = &lt;a href=&quot;http://www.google.com/search?q=new+msdn.microsoft.com&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;new&lt;/span&gt;&lt;/a&gt; Presenter.&lt;span style=&quot;color: #0000FF;&quot;&gt;ProductSearchPresenter&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=new+msdn.microsoft.com&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;new&lt;/span&gt;&lt;/a&gt; Model.&lt;span style=&quot;color: #0000FF;&quot;&gt;LocalModel&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;BasicModel&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Configuration&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;ConfigurationManager&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;ConnectionStrings&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;quot;AdventureWorks&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;ConnectionString&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;void&lt;/span&gt; btnSearch_Click&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;object&lt;/span&gt; sender, EventArgs e&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._presenter.&lt;span style=&quot;color: #0000FF;&quot;&gt;ExecuteProductSearch&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #FF0000;&quot;&gt;string&lt;/span&gt; Presenter.&lt;span style=&quot;color: #0000FF;&quot;&gt;Views&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;IProductSearchView&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;SearchText&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;return&lt;/span&gt; tbSearch.&lt;span style=&quot;color: #0000FF;&quot;&gt;Text&lt;/span&gt;; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt; tbSearch.&lt;span style=&quot;color: #0000FF;&quot;&gt;Text&lt;/span&gt; = value; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #FF0000;&quot;&gt;int&lt;/span&gt; Presenter.&lt;span style=&quot;color: #0000FF;&quot;&gt;Views&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;IProductSearchView&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;ResultCount&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt; lblResultCount.&lt;span style=&quot;color: #0000FF;&quot;&gt;Text&lt;/span&gt; = value.&lt;span style=&quot;color: #0000FF;&quot;&gt;ToString&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;Model.&lt;span style=&quot;color: #0000FF;&quot;&gt;Entities&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Product&lt;/span&gt;&amp;gt; Presenter.&lt;span style=&quot;color: #0000FF;&quot;&gt;Views&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;IProductSearchView&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;SearchResults&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;value != &lt;span style=&quot;color: #0600FF;&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; value.&lt;span style=&quot;color: #0000FF;&quot;&gt;Count&lt;/span&gt; &amp;gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rptProducts.&lt;span style=&quot;color: #0000FF;&quot;&gt;DataSource&lt;/span&gt; = value;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rptProducts.&lt;span style=&quot;color: #0000FF;&quot;&gt;DataBind&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #FF0000;&quot;&gt;bool&lt;/span&gt; Presenter.&lt;span style=&quot;color: #0000FF;&quot;&gt;Views&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;IProductSearchView&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;DisplayResults&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt; tblResults.&lt;span style=&quot;color: #0000FF;&quot;&gt;Visible&lt;/span&gt; = value; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb90100&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As the presenter populates properties in the view, the information is automatically reflected on the page. The actual logic of how the business functions are called and populate those properties are neatly packaged up in the Presenter and View interface and very little logic occurs in the actual web form.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;csharp&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;csharp&quot; id=&quot;cb13992&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;class&lt;/span&gt; ProductSearchPresenter : BasePresenter &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;protected&lt;/span&gt; Views.&lt;span style=&quot;color: #0000FF;&quot;&gt;IProductSearchView&lt;/span&gt; _view;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;public&lt;/span&gt; ProductSearchPresenter&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;Model.&lt;span style=&quot;color: #0000FF;&quot;&gt;IModel&lt;/span&gt; model, Views.&lt;span style=&quot;color: #0000FF;&quot;&gt;IProductSearchView&lt;/span&gt; view&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; : &lt;span style=&quot;color: #0600FF;&quot;&gt;base&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;model&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._view = view;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._view.&lt;span style=&quot;color: #0000FF;&quot;&gt;ResultCount&lt;/span&gt; = &lt;span style=&quot;color: #FF0000;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._view.&lt;span style=&quot;color: #0000FF;&quot;&gt;DisplayResults&lt;/span&gt; = &lt;span style=&quot;color: #0600FF;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;void&lt;/span&gt; ExecuteProductSearch&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; List&amp;lt;Model.&lt;span style=&quot;color: #0000FF;&quot;&gt;Entities&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Product&lt;/span&gt;&amp;gt; results;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; results = &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._model.&lt;span style=&quot;color: #0000FF;&quot;&gt;SearchProduct&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._view.&lt;span style=&quot;color: #0000FF;&quot;&gt;SearchText&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;results.&lt;span style=&quot;color: #0000FF;&quot;&gt;Count&lt;/span&gt; &amp;gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._view.&lt;span style=&quot;color: #0000FF;&quot;&gt;ResultCount&lt;/span&gt; = results.&lt;span style=&quot;color: #0000FF;&quot;&gt;Count&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._view.&lt;span style=&quot;color: #0000FF;&quot;&gt;DisplayResults&lt;/span&gt; = &lt;span style=&quot;color: #0600FF;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._view.&lt;span style=&quot;color: #0000FF;&quot;&gt;SearchResults&lt;/span&gt; = results;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._view.&lt;span style=&quot;color: #0000FF;&quot;&gt;ResultCount&lt;/span&gt; = &lt;span style=&quot;color: #FF0000;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._view.&lt;span style=&quot;color: #0000FF;&quot;&gt;DisplayResults&lt;/span&gt; = &lt;span style=&quot;color: #0600FF;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;._view.&lt;span style=&quot;color: #0000FF;&quot;&gt;SearchResults&lt;/span&gt; = &lt;span style=&quot;color: #0600FF;&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb80653&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;To create a unit test, we define a simple view that implements the view interface, execute the presenter logic, and verify the properties are populated the way we would expect when the same presenter calls are made from the interface.&lt;/p&gt;

&lt;h3&gt;Extending the Architecture Further&lt;/h3&gt;
&lt;p&gt;Extending the application to display product search in a different manner would only require the addition of a new interface that also implements the Product Search View. A Silverlight front-end would only require creating the basic project, implementing the product search View, and wiring the new interface controls to the view properties. To replace the direct mode reference with a service reference, we could create a service facade that implemented the IModel interface, connected to a local or remote WCF service behid the scenes to handle the real model logic. And finally, instead of counting on our QA department to test all of the application interactions, we can create unit tests directly against the Presenter and Views to ensure that all of the interactions below the top surface of the application are happening consistently and to our expectation.&lt;/p&gt;

&lt;h2&gt;Your Turn&lt;/h2&gt;
&lt;p&gt;Getting this much of the architecture working is a good first step. I took a number of shortcuts on the BasicModel class in my example, but I now have a functional Model-View-Presenter application to play with. Hopefully there was enough information in the article to interest you in trying this out on your own. I urge you to read the articles linked in the top of the post (or several more in my &lt;a href=&quot;http://delicious.com/tarwn/model-view-presenter&quot; title=&quot;Eli's Delicious bookmarks for M-V-P&quot; target=&quot;_blank&quot;&gt;Model-View-Presentation bookmarks&lt;/a&gt;) and come up with your own diagrams and sample project. Even doing a small project will force you to run into questions and considerations you wouldn't have had by simply reading about it, not to mention unrelated tidbits you will pick up along the way (for instance, I also learned about &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms668604.aspx&quot; title=&quot;ObservableCollection at MSDN&quot; target=&quot;_blank&quot;&gt;ObservableCollections&lt;/a&gt; today).&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/model-view-presenter-looking-at-passive&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/model-view-presenter-looking-at-passive&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/model-view-presenter-looking-at-passive&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<p>Model-View-Presenter is an architecture pattern that defines a structure for behavior and logic at the UI level. M-V-P separates the logic of the presentation, such as interacting with back-end services and the business layer, from the mechanics of displaying buttons and interface components. </p>

<p>I often build small projects to help understand and grow my skills as a developer, architect, and all-around technologist (as may be apparent from the <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9" target="_blank" title="See all of my posts at LTD">wide range of topics I post on</a>). Today I worked with a combination of Visio and Visual Studio to build a sample project to play with the Passive View concept and to help grow my own understanding of the concept. This post will cover the Visio side of my learning-curve.</p>

<p>You can read more about Model View Presenter at <a href="http://en.wikipedia.org/wiki/Model-view-presenter" target="_blank" title="Model-View-Presenter at Wikipedia">Wikipedia</a> and <a href=http://msdn.microsoft.com/en-us/magazine/cc188690.aspx"" target="_blank" title="Model View Presenter by Jean-Paul Boodhoo on MSDN">MSDN</a>. Perhaps the best information can be found on Martin Fowler's site, where he has separate write-ups on <a href="http://www.martinfowler.com/eaaDev/PassiveScreen.html" target=_blank" title="Passive View pattern">Passive View</a> and <a href="http://www.martinfowler.com/eaaDev/SupervisingPresenter.html" target=_blank" title="Supervising Controller Pattern">Supervising Controller</a>.</p>

<div style="background-color:#FFFFCC; padding: .5em; margin: .5em; border: 1px solid #DDDDAA; color: #333333; font-size: 80%;">Note: I know some people were waiting for another Virtual Lab entry this week, and here I am writing about Architecture instead. Don't worry, the virtual lab series will continue, I just felt like doing a write-up while I was playing this past weekend.</div>

<h2>Passive View</h2>
<p>Passive View is a subset of the Model-View-Presenter pattern. In Passive View, the interface is responsible for handling interface-specific logic, such as figuring out how to put a value in a textbox or react to events from button clicks, but all actions and logic outside of the raw UI are sent to the Presenter to execute or manage. The Presenter is responsible for calling business methods in the Business model and updating the data that is available in the View. </p>

<div style="text-align: center; font-size: .8em; color: #666666;">
<img src="http://tiernok.com/LTDBlog/MVP/mvp.png" alt="Basic Model-View-Presenter diagram" /><br />
Basic Model-View-Presenter Diagram
</div>

<p>From the outside in, the architecture for Passive View looks something like this:</p>
<ul>
	<li>UI - The User Interface reflects what is going on beneath it by implementing one or more View interfaces</li>
	<li>Presenter - The Presenter receives interactions from the UI or Model and updates the Views it is attached to</li>
	<li>Model - The model is a facade or black box in our diagram, behind which is a business logic layer and data layer</li>
</ul>

<p>In a flat architecture we would collect data from the interface, perhaps do some business and data validation, and then save it directly to a database using stored procedures or inline SQL. Defining a data access layer (or data model like entity framework) allows our application to operate on cohesive, defined objects that are meaningful to the application and stored and retrieved consistently. Defining a business logic layer allows us to centralize business rules that operate on entities in our application in a manner that is consistent with the business and internally consistent in the application, minimizing the risk that occurs when making changes to the business flow. Separating the logic of populating inputs and responding to button presses on the UI from the information being communicated to the end user and conceptual responses to their input allows the system to interact with the user consistently across any number of interfaces into the same application.</p>

<p>The definition of each level increases our ability to automate testing and supports greater <a href="http://en.wikipedia.org/wiki/Separation_of_concerns" title="Separation of Concerns at Wikipedia" target="_blank">Separation of Concerns</a>.</p>

<h2>Implementing a Sample Project</h2>
<p>My learning exercise has been the the creation of an ASP.Net search page that allows an end user (customer) to search for finished products from the AdventureWorks sample database. The architecture and design decisions were done as an exercise in Visio using simple shapes and layouts.</p>

<p>My example application has several functional and non-functional requirements:</p>
<ol>
	<li>Functional - Display product number, name, list price, and available quantity in tabular format</li>
	<li>Functional - Provide a basic search input and button to search product names</li>
	<li>Non-Functional - Implement an M-V-P pattern - Obviously the purpose of this whole exercise</li>
	<li>Non-Functional - Use a simple model stack that can be easily replaced with a Service-Oriented one at a later time</li>
	<li>Non-Functional - Build with the idea that we will later create a Silverlight or WPF front-end</li>
	<li>Non-Functional - Make pretty pictures for article</li>
</ol>

<p><i>My unwritten, final requirement was to finish the whole thing in half a day, though luckily I didn't define whether I intended that to mean 4 hours or 12.</i></p>

<h3>Initial Architecture</h3>
<p>To start I created a diagram of the application architecture:</p>
<div style="text-align: center; font-size: .8em; color: #666666;">
<img src="http://tiernok.com/LTDBlog/MVP/mvp_arch_01.png" alt="More extensive M-V-P Diagram" /><br />
More Extensive Model-View-Presenter Diagram
</div>
<p>The purple layer is my presentation layer, which reflects the View. The blue layer is my Presenter layer which contains the logic for interacting between the end user and interface as well as a definition, or contract, of the information available in the View. The Green is the Model (or is behind the model, depending on your viewpoint) and exposes business functions and data entities for the Presenter to interact with.</p>

<h3>Class Layout</h3>
<p>Once the high level diagram was completed, I could approach the task of creating some base classes and interfaces to use in implementing the project.</p>
<ul>
	<li>Model.IModel - Generic Model Interface to expose business calls to Presenters</li>
	<li>Presenter.IView - Generic View Interface that all Presenters can interact with and all screens implement</li>
	<li>Presenter.BasePresenter - Generic Presenter class that all Presenters will implement</li>
</ul>

<p>To keep the project to a single morning but also allow the ability to come back and build a more architecturally sound solution, I implemented the Model in a very basic fashion that was referenced locally by the Presenter project and makes direct calls to SQL Server using ADO and parametrized, inline SQL. This buys me the benefits of having a well-defined Model (via the interface) but allows me concentrate my time and effort on the learning part of the project (ie, the M-V-P interaction and structure). Defining the model interface also leaves me open to come back and replace it with better separated code and the ability to create a model that acts as a facade to a service stack, instead of local DLLs.</p>
<ul>
	<li>Model.BasicModel.Model - Basic implementation of a model that will interact with AdventureWorks on SQL Server</li>
	<li>Model.Entities.Product - A Product Entity that can be communicated between an IModel instance and Presenter<br />
	<li>Presenter.ProductSearchPresenter - A Presenter to manage product search interface</li>
	<li>Presenter.IProductSearchView - A view of the data involved in a product search</li>
	<li>ProductSearch.aspx - A web page that implements the IProductSearchView and interacts with the ProductSearchPresenter</li>
</li></ul>

<p>My final Visio diagram ended up looking like this:</p>
<div style="text-align: center; font-size: .8em; color: #666666;">
<img src="http://tiernok.com/LTDBlog/MVP/mvp_arch_02.png" alt="Example Application Diagram" /><br />
Diagram of Example Application
</div>

<p>In this case the left side represents basic components (bases classes and interfaces) that are used to define common structure or contracts on the right side. </p>

<h2>The Code</h2>
<p>For the purposes of the example project, my view has properties for Search Text, a Search Count (number of results), Results (a generic list of the Product entity), and a boolean indicating whether there are results to display. My Web Form implements these properties, tying them to elements on the screen.</p>

<div class="codebox"><div class="codeheader">Code: <span>csharp</span></div><div class="codeholder"><div class="csharp" id="cb70429" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">public</span> partial <span style="color: #FF0000;">class</span> WebForm1 : <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>.<span style="color: #0000FF;">Page</span>, Presenter.<span style="color: #0000FF;">Views</span>.<span style="color: #0000FF;">IProductSearchView</span> <span style="color: #000000;">&#123;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; Presenter.<span style="color: #0000FF;">ProductSearchPresenter</span> _presenter;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">void</span> Page_Load<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, EventArgs e<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; btnSearch.<span style="color: #0000FF;">Click</span> += <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> EventHandler<span style="color: #000000;">&#40;</span>btnSearch_Click<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rptProducts.<span style="color: #0000FF;">ItemDataBound</span> += <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> RepeaterItemEventHandler<span style="color: #000000;">&#40;</span>rptProducts_ItemDataBound<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _presenter = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Presenter.<span style="color: #0000FF;">ProductSearchPresenter</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Model.<span style="color: #0000FF;">LocalModel</span>.<span style="color: #0000FF;">BasicModel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">System</span>.<span style="color: #0000FF;">Configuration</span>.<span style="color: #0000FF;">ConfigurationManager</span>.<span style="color: #0000FF;">ConnectionStrings</span><span style="color: #000000;">&#91;</span><span style="color: #808080;">&quot;AdventureWorks&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ConnectionString</span><span style="color: #000000;">&#41;</span>, <span style="color: #0600FF;">this</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">void</span> btnSearch_Click<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, EventArgs e<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>._presenter.<span style="color: #0000FF;">ExecuteProductSearch</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF0000;">string</span> Presenter.<span style="color: #0000FF;">Views</span>.<span style="color: #0000FF;">IProductSearchView</span>.<span style="color: #0000FF;">SearchText</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> tbSearch.<span style="color: #0000FF;">Text</span>; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set <span style="color: #000000;">&#123;</span> tbSearch.<span style="color: #0000FF;">Text</span> = value; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF0000;">int</span> Presenter.<span style="color: #0000FF;">Views</span>.<span style="color: #0000FF;">IProductSearchView</span>.<span style="color: #0000FF;">ResultCount</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set <span style="color: #000000;">&#123;</span> lblResultCount.<span style="color: #0000FF;">Text</span> = value.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; List&lt;Model.<span style="color: #0000FF;">Entities</span>.<span style="color: #0000FF;">Product</span>&gt; Presenter.<span style="color: #0000FF;">Views</span>.<span style="color: #0000FF;">IProductSearchView</span>.<span style="color: #0000FF;">SearchResults</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>value != <span style="color: #0600FF;">null</span> &amp;&amp; value.<span style="color: #0000FF;">Count</span> &gt; <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rptProducts.<span style="color: #0000FF;">DataSource</span> = value;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rptProducts.<span style="color: #0000FF;">DataBind</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF0000;">bool</span> Presenter.<span style="color: #0000FF;">Views</span>.<span style="color: #0000FF;">IProductSearchView</span>.<span style="color: #0000FF;">DisplayResults</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set <span style="color: #000000;">&#123;</span> tblResults.<span style="color: #0000FF;">Visible</span> = value; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />...<br /><br /></div><div id="cb70236" style="display: none; color: red;"></div></div></div>

<p>As the presenter populates properties in the view, the information is automatically reflected on the page. The actual logic of how the business functions are called and populate those properties are neatly packaged up in the Presenter and View interface and very little logic occurs in the actual web form.</p>

<div class="codebox"><div class="codeheader">Code: <span>csharp</span></div><div class="codeholder"><div class="csharp" id="cb28110" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> ProductSearchPresenter : BasePresenter <span style="color: #000000;">&#123;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">protected</span> Views.<span style="color: #0000FF;">IProductSearchView</span> _view;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">public</span> ProductSearchPresenter<span style="color: #000000;">&#40;</span>Model.<span style="color: #0000FF;">IModel</span> model, Views.<span style="color: #0000FF;">IProductSearchView</span> view<span style="color: #000000;">&#41;</span> : <span style="color: #0600FF;">base</span><span style="color: #000000;">&#40;</span>model<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>._view = view;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>._view.<span style="color: #0000FF;">ResultCount</span> = <span style="color: #FF0000;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>._view.<span style="color: #0000FF;">DisplayResults</span> = <span style="color: #0600FF;">false</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> ExecuteProductSearch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List&lt;Model.<span style="color: #0000FF;">Entities</span>.<span style="color: #0000FF;">Product</span>&gt; results;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; results = <span style="color: #0600FF;">this</span>._model.<span style="color: #0000FF;">SearchProduct</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>._view.<span style="color: #0000FF;">SearchText</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>results.<span style="color: #0000FF;">Count</span> &gt; <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>._view.<span style="color: #0000FF;">ResultCount</span> = results.<span style="color: #0000FF;">Count</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>._view.<span style="color: #0000FF;">DisplayResults</span> = <span style="color: #0600FF;">true</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>._view.<span style="color: #0000FF;">SearchResults</span> = results;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">else</span> <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>._view.<span style="color: #0000FF;">ResultCount</span> = <span style="color: #FF0000;">0</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>._view.<span style="color: #0000FF;">DisplayResults</span> = <span style="color: #0600FF;">false</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>._view.<span style="color: #0000FF;">SearchResults</span> = <span style="color: #0600FF;">null</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br /><br /></div><div id="cb9612" style="display: none; color: red;"></div></div></div>

<p>To create a unit test, we define a simple view that implements the view interface, execute the presenter logic, and verify the properties are populated the way we would expect when the same presenter calls are made from the interface.</p>

<h3>Extending the Architecture Further</h3>
<p>Extending the application to display product search in a different manner would only require the addition of a new interface that also implements the Product Search View. A Silverlight front-end would only require creating the basic project, implementing the product search View, and wiring the new interface controls to the view properties. To replace the direct mode reference with a service reference, we could create a service facade that implemented the IModel interface, connected to a local or remote WCF service behid the scenes to handle the real model logic. And finally, instead of counting on our QA department to test all of the application interactions, we can create unit tests directly against the Presenter and Views to ensure that all of the interactions below the top surface of the application are happening consistently and to our expectation.</p>

<h2>Your Turn</h2>
<p>Getting this much of the architecture working is a good first step. I took a number of shortcuts on the BasicModel class in my example, but I now have a functional Model-View-Presenter application to play with. Hopefully there was enough information in the article to interest you in trying this out on your own. I urge you to read the articles linked in the top of the post (or several more in my <a href="http://delicious.com/tarwn/model-view-presenter" title="Eli's Delicious bookmarks for M-V-P" target="_blank">Model-View-Presentation bookmarks</a>) and come up with your own diagrams and sample project. Even doing a small project will force you to run into questions and considerations you wouldn't have had by simply reading about it, not to mention unrelated tidbits you will pick up along the way (for instance, I also learned about <a href="http://msdn.microsoft.com/en-us/library/ms668604.aspx" title="ObservableCollection at MSDN" target="_blank">ObservableCollections</a> today).</p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/model-view-presenter-looking-at-passive"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/model-view-presenter-looking-at-passive&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/model-view-presenter-looking-at-passive">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/Architect/DesigningSoftware/model-view-presenter-looking-at-passive#comments</comments>
		</item>
				<item>
			<title>Virtual Lab: Setting up Database Mail on SQL Server 2008 R2</title>
			<link>http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/virtual-lab-setting-up-database-mail-on</link>
			<pubDate>Tue, 06 Jul 2010 12:02:26 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="main">Data Modelling &amp; Design</category>			<guid isPermaLink="false">890@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;div class=&quot;acc_header&quot;&gt;
After our installation of SQL Server 2008 R2 &lt;a href=&quot;http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2&quot; alt=&quot;Click here to catch up on that article if you missed it&quot; target=&quot;_blank&quot;&gt;a few weeks ago&lt;/a&gt;, I mentioned that we still had some additional setup tasks before we could consider the server to be done. This article covers setting up DatabaseMail, the internal mail client/management system that will allow us to use built-in alerts (among other things).&lt;br /&gt;
&lt;br /&gt;
&lt;label&gt;Technical Area:&lt;/label&gt; Accidental Database Administrator&lt;br /&gt;&lt;br /&gt;
&lt;label class=&quot;diff&quot;&gt;Level of Difficulty: &lt;/label&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/dr_basic.png&quot; alt=&quot;Basic Difficulty&quot; /&gt;&lt;br /&gt;
&lt;label&gt;Additional Articles:&lt;/label&gt;&lt;a href=&quot;http://wiki.lessthandot.com/index.php/Virtual_Lab&quot; title=&quot;View the wiki entry&quot;&gt;Virtual Lab entry on the LTD Wiki&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;

&lt;p&gt;Database Mail is a subsystem that acts like a &lt;a href=&quot;http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol&quot; title=&quot;Simple Mail Transport Protocol&quot;&gt;SMTP&lt;/a&gt; client, allowing us to send emails from SQL Server processes and scripts. It replaces SQL Mail and doesn't require a local installation of additional software (like Outlook, the quick fix) to function. &lt;/p&gt;

&lt;h2&gt;Account, Profile, Service Broker, what?&lt;/h2&gt;
&lt;p&gt;Database Mail expands on the concept of sending mail to include all of the features we wanted in SQLMail. This grown up version of mail uses SMTP to communicate with mail servers, no longer requiring a MAPI component to communicate messages (the reason we used to install products like Outlook to make SQLMail work). Behind the scenes, Database Mail uses Service Broker to manage email in queues, rather than trying an immediate send. Profiles allow us to define a chain of fail-over accounts to send from, so that messages are never left undelivered due to a primary email server being unavailable. And accounts are exactly what they sound like, individual, unique accounts that we can setup to use a variety of authentication and SMTP options.&lt;/p&gt;


&lt;h2&gt;From the GUI&lt;/h2&gt;
&lt;p&gt;Database Mail is something we want to setup immediately on creating a new server. When we are working with a relatively small number of servers, the GUI is not a bad option for setting up some accounts.&lt;/p&gt;

&lt;p&gt;We'll start by setting up an administrator profile with then intent to send critical notifications and alerts to this profile.&lt;/p&gt;

&lt;p&gt;In SSMS we can right click the Database Mail entry under Management to begin the wizard.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/DatabaseMail/orig/01_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/DatabaseMail/01_config.png&quot; alt=&quot;SSMS DatabaseMail&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DatabaseMail Menu Item in SSMS
&lt;/div&gt;


&lt;p&gt;The Intro screen is fairly boring, so lets press &quot;Next&quot; and head to the main configuration page. This being the first time we are configuring DatabaseMail on our new server, we want to leave the first option selected and continue.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/DatabaseMail/orig/02_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/DatabaseMail/02_config.png&quot; alt=&quot;SSMS DatabaseMail Wizard&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DatabaseMail Wizard in SSMS
&lt;/div&gt;

&lt;p&gt;A quick check by the wizard and it determines that components for Database Mail aren't available on the server yet, so it asks us if we want to go ahead and install them (yes).&lt;/p&gt;

&lt;div class=&quot;hint&quot;&gt;
How did the server know Database Mail wasn't configured, and what did it do when we pressed 'Yes'? &lt;br /&gt;&lt;br /&gt;
There is an advanced option in the system configurations called 'Database Mail XPs'. When the option is set to '0' (which is the default), then the Database Mail process doesn't run. So the dialog simply checked the current value and, when we selected 'Yes', updated the configuration to a value of '1'.
&lt;/div&gt;

&lt;p&gt;Profiles are used to represent a set of email addresses which allows us to represent a single person (or system) with multiple fail-over accounts. If an error occurs when the system is attempting to send mail from the first account in a profile, it fails to the next and retries, continuing until it either runs out of accounts or successfully sends it's message.&lt;/p&gt;

&lt;p&gt;Lets enter a Profile Name of &quot;The Accidental Admin&quot;.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/DatabaseMail/orig/03_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/DatabaseMail/02_config.png&quot; alt=&quot;SSMS DatabaseMail Wizard&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DatabaseMail Wizard in SSMS
&lt;/div&gt;

&lt;p&gt;Now we'll add the first two accounts to this profile, each on a different network. Many admins will choose a non-local account with an external provider as their primary to reduce the chances that emails will not get through when other issues are happening. As many of you know, when a server room overheats the exchange server is always the first to go, so we will start with an external provider and fail-over to an internal one. Keep in mind that these are the accounts the database will send emails &lt;i&gt;from&lt;/i&gt; when using the specified profile, not to.&lt;/p&gt;

&lt;p&gt;Creating an account is fairly straightforward, simply enter the details for where you would like the email to be sent and any authentication options that are necessary. In this case we want to create a minimum of two accounts so the failover can work properly.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/DatabaseMail/orig/04_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/DatabaseMail/04_config.png&quot; alt=&quot;SSMS DatabaseMail Wizard&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DatabaseMail Wizard in SSMS - Account Entry
&lt;/div&gt;

&lt;p&gt;Now that we have two accounts, we can move on.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/DatabaseMail/orig/05_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/DatabaseMail/05_config.png&quot; alt=&quot;SSMS DatabaseMail Wizard&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DatabaseMail Wizard in SSMS - Account View
&lt;/div&gt;

&lt;p&gt;The next step is to decide whether our profile is going to be public or private. A public profile will be accessible to other people working on the system, whereas a private one will not. In this case we will make the profile public but be aware that this means anyone will be able to us the database server to send mail from this particular profile.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/DatabaseMail/orig/06_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/DatabaseMail/06_config.png&quot; alt=&quot;SSMS DatabaseMail Wizard&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DatabaseMail Wizard in SSMS - Profile Security
&lt;/div&gt;

&lt;p&gt;The last interactive step is to confirm or modify some additional system parameters. This step is not specific to configuring an email profile and accounts, it is displayed as the final step of setting up DatabaseMail (when setting up for the first time). I suggest reviewing the settings to ensure your comfortable with each of them.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/DatabaseMail/orig/07_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/DatabaseMail/07_config.png&quot; alt=&quot;SSMS DatabaseMail Wizard&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DatabaseMail Wizard in SSMS - System Parameters
&lt;/div&gt;

&lt;p&gt;After a final review screen, press the 'Finish' button to implement the changes.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/DatabaseMail/orig/08_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/DatabaseMail/08_config.png&quot; alt=&quot;SSMS DatabaseMail Wizard&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DatabaseMail Wizard in SSMS - Finished
&lt;/div&gt;

&lt;p&gt;The last step is to test our new setup. Right-click the Database Mail menu option in SSMS and select &quot;Send Test Email...&quot;.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/DatabaseMail/orig/09_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/DatabaseMail/09_config.png&quot; alt=&quot;SSMS DatabaseMail - Test Email&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SSMS Menu - Sending a Test Email
&lt;/div&gt;

&lt;p&gt;After entering an email address for our test message, we can hit the &quot;Send&quot; button and wait for confirmation of our ability to hit &quot;Next, Next, Finish&quot;.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/DatabaseMail/orig/10_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/DatabaseMail/10_config.png&quot; alt=&quot;SSMS DatabaseMail - Test Email Dialog&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SSMS DatabaseMail - Test Email Dialog
&lt;/div&gt;

&lt;h2&gt;or From a Script&lt;/h2&gt;
&lt;p&gt;Doing this on one server is pretty quick. Banging through the dialog on 20 (or with multiple profiles) is not only going to be a bit slower but probably guarantees at least one bad entry along the way. Luckily there is nothing magical about what SSMS is doing to configure these accounts and profiles, just a wizard driving system procedures behind the scenes. We can follow the same process programmatically and create a setup script. Once we have a setup script, of course, we can then use it against multiple systems and if we save it then we not only can set up future servers the same way, but we have detailed documentation on exactly how our servers were setup when we need it 3 years later.&lt;/p&gt;

&lt;p&gt;Here are the commands we will be using:&lt;/p&gt;
&lt;dl&gt;
	&lt;dt&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms189631.aspx&quot; onclick=&quot;_blank&quot; title=&quot;Read more at MSDN&quot;&gt;sp_configure&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;This procedure is used to change SQL Server configurations&lt;/dd&gt;&lt;br /&gt;
	&lt;dt&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms188058.aspx&quot; onclick=&quot;_blank&quot; title=&quot;Read more at MSDN&quot;&gt;sysmail_add_profile_sp&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;Used to create a Database Mail Profile&lt;/dd&gt;&lt;br /&gt;
	&lt;dt&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms182804.aspx&quot; onclick=&quot;_blank&quot; title=&quot;Read more at MSDN&quot;&gt;sysmail_add_account_sp&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;Used to create a Database Mail Account&lt;/dd&gt;&lt;br /&gt;
	&lt;dt&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms186258.aspx&quot; onclick=&quot;_blank&quot; title=&quot;Read more at MSDN&quot;&gt;sysmail_add_profileaccount_sp&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;Used to tie a Database Mail Account to a Profile (Tab A in Slot &lt;img src=&quot;http://blogs.lessthandot.com/rsc/smilies/icon_cool.gif&quot; alt=&quot;&amp;#66;&amp;#41;&quot; class=&quot;middle&quot; /&gt;&lt;/dd&gt;&lt;br /&gt;
	&lt;dt&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms187911.aspx&quot; onclick=&quot;_blank&quot; title=&quot;Read more at MSDN&quot;&gt;sysmail_add_principalprofile_sp&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;Assign access rights to a Database Mail profile&lt;/dd&gt;&lt;br /&gt;
	&lt;dt&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms190307.aspx&quot; onclick=&quot;_blank&quot; title=&quot;Read more at MSDN&quot;&gt;sp_send_dbmail&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;And sending an email, of course&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;And if we put it all together then we can duplicate the wizardy approach above like so:&lt;/p&gt;
&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;tsql&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;tsql&quot; id=&quot;cb49360&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #008080;&quot;&gt;---- Enable the XPs for Database Mail&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;EXECUTE&lt;/span&gt; &lt;span style=&quot;color: #AF0000;&quot;&gt;SP_CONFIGURE&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;'show advanced'&lt;/span&gt;, &lt;span style=&quot;color: #000;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;RECONFIGURE&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;EXECUTE&lt;/span&gt; &lt;span style=&quot;color: #AF0000;&quot;&gt;SP_CONFIGURE&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;'Database Mail XPs'&lt;/span&gt;,&lt;span style=&quot;color: #000;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;RECONFIGURE&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;EXECUTE&lt;/span&gt; &lt;span style=&quot;color: #AF0000;&quot;&gt;SP_CONFIGURE&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;'show advanced'&lt;/span&gt;, &lt;span style=&quot;color: #000;&quot;&gt;0&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;RECONFIGURE&lt;/span&gt;;&lt;br /&gt;GO&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #008080;&quot;&gt;---- Create our Default Profile&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;DECLARE&lt;/span&gt; @newProfileId &lt;span style=&quot;color: #0000FF;&quot;&gt;INT&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;EXECUTE&lt;/span&gt; msdb.&lt;span style=&quot;color: #202020;&quot;&gt;dbo&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;sysmail_add_profile_sp&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; @profile_name = &lt;span style=&quot;color: #FF0000;&quot;&gt;'The Accidental Admin v2'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @description = &lt;span style=&quot;color: #FF0000;&quot;&gt;'A second version of the DB Admin email profile'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @profile_id = @newProfileId &lt;span style=&quot;color: #0000FF;&quot;&gt;OUTPUT&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;'Profile Created'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #008080;&quot;&gt;---- Create our accounts (You did plan on a minimum of two, right?)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;DECLARE&lt;/span&gt; @newPriAccountId &lt;span style=&quot;color: #0000FF;&quot;&gt;INT&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @newSecAccountId &lt;span style=&quot;color: #0000FF;&quot;&gt;INT&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;DECLARE&lt;/span&gt; @sender &lt;span style=&quot;color: #0000FF;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000;&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;SELECT&lt;/span&gt; @sender = &lt;span style=&quot;color: #FF0000;&quot;&gt;'DB SERVER - '&lt;/span&gt; + &lt;span style=&quot;color: #FF00FF;&quot;&gt;@@SERVERNAME&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #008080;&quot;&gt;-- External account using username/password&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;EXECUTE&lt;/span&gt; msdb.&lt;span style=&quot;color: #202020;&quot;&gt;dbo&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;sysmail_add_account_sp&lt;/span&gt; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; @account_name = &lt;span style=&quot;color: #FF0000;&quot;&gt;'External DBAdmin'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @email_address = &lt;span style=&quot;color: #FF0000;&quot;&gt;'AnAccount@ExternalService.com'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @display_name = @sender,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @description = &lt;span style=&quot;color: #FF0000;&quot;&gt;'Primary account for DB Admin profile'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @mailserver_name = &lt;span style=&quot;color: #FF0000;&quot;&gt;'mail.ExternalService.com'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @username = &lt;span style=&quot;color: #FF0000;&quot;&gt;'username'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @password = &lt;span style=&quot;color: #FF0000;&quot;&gt;'password'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @account_id = @newPriAccountId &lt;span style=&quot;color: #0000FF;&quot;&gt;OUTPUT&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #008080;&quot;&gt;-- Internal account using credentials from the account DB server is running under&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;EXECUTE&lt;/span&gt; msdb.&lt;span style=&quot;color: #202020;&quot;&gt;dbo&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;sysmail_add_account_sp&lt;/span&gt; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; @account_name = &lt;span style=&quot;color: #FF0000;&quot;&gt;'Internal DBAdmin'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @email_address = &lt;span style=&quot;color: #FF0000;&quot;&gt;'YourAccount@YourDomain.com'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @display_name = @sender,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @description = &lt;span style=&quot;color: #FF0000;&quot;&gt;'Secondary account for DB Admin profile'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @mailserver_name = &lt;span style=&quot;color: #FF0000;&quot;&gt;'mail.YourDomain.com'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @use_default_credentials = &lt;span style=&quot;color: #000;&quot;&gt;1&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @account_id = @newSecAccountId &lt;span style=&quot;color: #0000FF;&quot;&gt;OUTPUT&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;'Accounts Created: '&lt;/span&gt; + @sender;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&lt;span style=&quot;color: #008080;&quot;&gt;---- Add Accounts to Profile&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;EXECUTE&lt;/span&gt; msdb.&lt;span style=&quot;color: #202020;&quot;&gt;dbo&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;sysmail_add_profileaccount_sp&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; @profile_id = @newProfileId,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @account_id = @newPriAccountId,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @sequence_number = &lt;span style=&quot;color: #000;&quot;&gt;1&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;EXECUTE&lt;/span&gt; msdb.&lt;span style=&quot;color: #202020;&quot;&gt;dbo&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;sysmail_add_profileaccount_sp&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; @profile_id = @newProfileId,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @account_id = @newSecAccountId,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @sequence_number = &lt;span style=&quot;color: #000;&quot;&gt;2&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;'Accounts assigned to Profile'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Go&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #008080;&quot;&gt;---- And Then We Test&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #008080;&quot;&gt;-- Make sure you update the profile name with the value from above&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;EXECUTE&lt;/span&gt; msdb.&lt;span style=&quot;color: #202020;&quot;&gt;dbo&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;sp_send_dbmail&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; @profile_name = &lt;span style=&quot;color: #FF0000;&quot;&gt;'The Accidental Admin v2'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @subject = &lt;span style=&quot;color: #FF0000;&quot;&gt;'Test Database Mail Message'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @recipients = &lt;span style=&quot;color: #FF0000;&quot;&gt;'You@YourDomain.Com'&lt;/span&gt;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; @body = &lt;span style=&quot;color: #FF0000;&quot;&gt;'Test Message'&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;'Test Email Away!'&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb44911&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Running this script creates a setup similar to what we created in the first section, though some of the names have been changed (and I have removed my email address from the list so I don't get server updates when someone comes along and forgets to swap out the addresses).&lt;/p&gt;

&lt;h2&gt;And Now, Uses&lt;/h2&gt;
&lt;p&gt;So now that we have Database Mail setup, what are we going to use it for? Well, besides creating our own monitoring and email scripts, the built in Alerts component in SQL Server uses Database mail to tell us when critical parts of our server have decided to misbehave. SQL Agent jobs have the option to notify us when they fail and they do so using, yep, Database Mail. Setting up Database Mail and using it in each of these situations won't prevent problems from occurring, but it is the difference between finding out when the problem is occurring and finding out after the server has melted down. &lt;/p&gt;

&lt;p&gt;Next week will be something interesting, but I haven't determined what that will be yet, so we'll figure it out as we go.&lt;/p&gt;

&lt;p&gt;&lt;style&gt;
.mylab, .hint{
   margin: .5em 2em;
   padding: 1em 1em 1em 90px;
}
.mylab{
   border: 2px solid #CCEECC;
   background-color: #DDFFDD;
   background-image: url(http://tiernok.com/LTDBlog/mylab.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.hint{
   border: 2px solid #EEEECC;
   background-color: #FFFFDD;
   background-image: url(http://tiernok.com/LTDBlog/tip.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.screenshot{
   text-align: center;
   font-size: .8em;
   margin-bottom: 1em;
}
.acc_header{ position: relative; }
.acc_header label{ float: left; width: 150px; font-weight: bold;}
.acc_header br{  clear: left; }
.acc_header .diff{ margin-top: 3px; }
.evo_post_text dt{ width: 220px; }
.evo_post_text dd{ margin-left: 230px; }
&lt;/style&gt;&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/virtual-lab-setting-up-database-mail-on&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/virtual-lab-setting-up-database-mail-on&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/virtual-lab-setting-up-database-mail-on&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<div class="acc_header">
After our installation of SQL Server 2008 R2 <a href="http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2" alt="Click here to catch up on that article if you missed it" target="_blank">a few weeks ago</a>, I mentioned that we still had some additional setup tasks before we could consider the server to be done. This article covers setting up DatabaseMail, the internal mail client/management system that will allow us to use built-in alerts (among other things).<br />
<br />
<label>Technical Area:</label> Accidental Database Administrator<br /><br />
<label class="diff">Level of Difficulty: </label><img src="http://tiernok.com/LTDBlog/dr_basic.png" alt="Basic Difficulty" /><br />
<label>Additional Articles:</label><a href="http://wiki.lessthandot.com/index.php/Virtual_Lab" title="View the wiki entry">Virtual Lab entry on the LTD Wiki</a><br />
</div>

<p>Database Mail is a subsystem that acts like a <a href="http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol" title="Simple Mail Transport Protocol">SMTP</a> client, allowing us to send emails from SQL Server processes and scripts. It replaces SQL Mail and doesn't require a local installation of additional software (like Outlook, the quick fix) to function. </p>

<h2>Account, Profile, Service Broker, what?</h2>
<p>Database Mail expands on the concept of sending mail to include all of the features we wanted in SQLMail. This grown up version of mail uses SMTP to communicate with mail servers, no longer requiring a MAPI component to communicate messages (the reason we used to install products like Outlook to make SQLMail work). Behind the scenes, Database Mail uses Service Broker to manage email in queues, rather than trying an immediate send. Profiles allow us to define a chain of fail-over accounts to send from, so that messages are never left undelivered due to a primary email server being unavailable. And accounts are exactly what they sound like, individual, unique accounts that we can setup to use a variety of authentication and SMTP options.</p>


<h2>From the GUI</h2>
<p>Database Mail is something we want to setup immediately on creating a new server. When we are working with a relatively small number of servers, the GUI is not a bad option for setting up some accounts.</p>

<p>We'll start by setting up an administrator profile with then intent to send critical notifications and alerts to this profile.</p>

<p>In SSMS we can right click the Database Mail entry under Management to begin the wizard.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/DatabaseMail/orig/01_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/DatabaseMail/01_config.png" alt="SSMS DatabaseMail" /></a><br />
	DatabaseMail Menu Item in SSMS
</div>


<p>The Intro screen is fairly boring, so lets press "Next" and head to the main configuration page. This being the first time we are configuring DatabaseMail on our new server, we want to leave the first option selected and continue.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/DatabaseMail/orig/02_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/DatabaseMail/02_config.png" alt="SSMS DatabaseMail Wizard" /></a><br />
	DatabaseMail Wizard in SSMS
</div>

<p>A quick check by the wizard and it determines that components for Database Mail aren't available on the server yet, so it asks us if we want to go ahead and install them (yes).</p>

<div class="hint">
How did the server know Database Mail wasn't configured, and what did it do when we pressed 'Yes'? <br /><br />
There is an advanced option in the system configurations called 'Database Mail XPs'. When the option is set to '0' (which is the default), then the Database Mail process doesn't run. So the dialog simply checked the current value and, when we selected 'Yes', updated the configuration to a value of '1'.
</div>

<p>Profiles are used to represent a set of email addresses which allows us to represent a single person (or system) with multiple fail-over accounts. If an error occurs when the system is attempting to send mail from the first account in a profile, it fails to the next and retries, continuing until it either runs out of accounts or successfully sends it's message.</p>

<p>Lets enter a Profile Name of "The Accidental Admin".</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/DatabaseMail/orig/03_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/DatabaseMail/02_config.png" alt="SSMS DatabaseMail Wizard" /></a><br />
	DatabaseMail Wizard in SSMS
</div>

<p>Now we'll add the first two accounts to this profile, each on a different network. Many admins will choose a non-local account with an external provider as their primary to reduce the chances that emails will not get through when other issues are happening. As many of you know, when a server room overheats the exchange server is always the first to go, so we will start with an external provider and fail-over to an internal one. Keep in mind that these are the accounts the database will send emails <i>from</i> when using the specified profile, not to.</p>

<p>Creating an account is fairly straightforward, simply enter the details for where you would like the email to be sent and any authentication options that are necessary. In this case we want to create a minimum of two accounts so the failover can work properly.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/DatabaseMail/orig/04_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/DatabaseMail/04_config.png" alt="SSMS DatabaseMail Wizard" /></a><br />
	DatabaseMail Wizard in SSMS - Account Entry
</div>

<p>Now that we have two accounts, we can move on.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/DatabaseMail/orig/05_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/DatabaseMail/05_config.png" alt="SSMS DatabaseMail Wizard" /></a><br />
	DatabaseMail Wizard in SSMS - Account View
</div>

<p>The next step is to decide whether our profile is going to be public or private. A public profile will be accessible to other people working on the system, whereas a private one will not. In this case we will make the profile public but be aware that this means anyone will be able to us the database server to send mail from this particular profile.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/DatabaseMail/orig/06_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/DatabaseMail/06_config.png" alt="SSMS DatabaseMail Wizard" /></a><br />
	DatabaseMail Wizard in SSMS - Profile Security
</div>

<p>The last interactive step is to confirm or modify some additional system parameters. This step is not specific to configuring an email profile and accounts, it is displayed as the final step of setting up DatabaseMail (when setting up for the first time). I suggest reviewing the settings to ensure your comfortable with each of them.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/DatabaseMail/orig/07_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/DatabaseMail/07_config.png" alt="SSMS DatabaseMail Wizard" /></a><br />
	DatabaseMail Wizard in SSMS - System Parameters
</div>

<p>After a final review screen, press the 'Finish' button to implement the changes.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/DatabaseMail/orig/08_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/DatabaseMail/08_config.png" alt="SSMS DatabaseMail Wizard" /></a><br />
	DatabaseMail Wizard in SSMS - Finished
</div>

<p>The last step is to test our new setup. Right-click the Database Mail menu option in SSMS and select "Send Test Email...".</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/DatabaseMail/orig/09_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/DatabaseMail/09_config.png" alt="SSMS DatabaseMail - Test Email" /></a><br />
	SSMS Menu - Sending a Test Email
</div>

<p>After entering an email address for our test message, we can hit the "Send" button and wait for confirmation of our ability to hit "Next, Next, Finish".</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/DatabaseMail/orig/10_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/DatabaseMail/10_config.png" alt="SSMS DatabaseMail - Test Email Dialog" /></a><br />
	SSMS DatabaseMail - Test Email Dialog
</div>

<h2>or From a Script</h2>
<p>Doing this on one server is pretty quick. Banging through the dialog on 20 (or with multiple profiles) is not only going to be a bit slower but probably guarantees at least one bad entry along the way. Luckily there is nothing magical about what SSMS is doing to configure these accounts and profiles, just a wizard driving system procedures behind the scenes. We can follow the same process programmatically and create a setup script. Once we have a setup script, of course, we can then use it against multiple systems and if we save it then we not only can set up future servers the same way, but we have detailed documentation on exactly how our servers were setup when we need it 3 years later.</p>

<p>Here are the commands we will be using:</p>
<dl>
	<dt><a href="http://msdn.microsoft.com/en-us/library/ms189631.aspx" onclick="_blank" title="Read more at MSDN">sp_configure</a></dt><dd>This procedure is used to change SQL Server configurations</dd><br />
	<dt><a href="http://msdn.microsoft.com/en-us/library/ms188058.aspx" onclick="_blank" title="Read more at MSDN">sysmail_add_profile_sp</a></dt><dd>Used to create a Database Mail Profile</dd><br />
	<dt><a href="http://msdn.microsoft.com/en-us/library/ms182804.aspx" onclick="_blank" title="Read more at MSDN">sysmail_add_account_sp</a></dt><dd>Used to create a Database Mail Account</dd><br />
	<dt><a href="http://msdn.microsoft.com/en-us/library/ms186258.aspx" onclick="_blank" title="Read more at MSDN">sysmail_add_profileaccount_sp</a></dt><dd>Used to tie a Database Mail Account to a Profile (Tab A in Slot <img src="http://blogs.lessthandot.com/rsc/smilies/icon_cool.gif" alt="&#66;&#41;" class="middle" /></dd><br />
	<dt><a href="http://msdn.microsoft.com/en-us/library/ms187911.aspx" onclick="_blank" title="Read more at MSDN">sysmail_add_principalprofile_sp</a></dt><dd>Assign access rights to a Database Mail profile</dd><br />
	<dt><a href="http://msdn.microsoft.com/en-us/library/ms190307.aspx" onclick="_blank" title="Read more at MSDN">sp_send_dbmail</a></dt><dd>And sending an email, of course</dd>
</dl>

<p>And if we put it all together then we can duplicate the wizardy approach above like so:</p>
<div class="codebox"><div class="codeheader">Code: <span>tsql</span></div><div class="codeholder"><div class="tsql" id="cb88210" style="display: block; color: rgb(0, 0, 0);"><span style="color: #008080;">---- Enable the XPs for Database Mail</span><br /><span style="color: #0000FF;">EXECUTE</span> <span style="color: #AF0000;">SP_CONFIGURE</span> <span style="color: #FF0000;">'show advanced'</span>, <span style="color: #000;">1</span>;<br /><span style="color: #0000FF;">RECONFIGURE</span>;<br /><span style="color: #0000FF;">EXECUTE</span> <span style="color: #AF0000;">SP_CONFIGURE</span> <span style="color: #FF0000;">'Database Mail XPs'</span>,<span style="color: #000;">1</span>;<br /><span style="color: #0000FF;">RECONFIGURE</span>;<br /><span style="color: #0000FF;">EXECUTE</span> <span style="color: #AF0000;">SP_CONFIGURE</span> <span style="color: #FF0000;">'show advanced'</span>, <span style="color: #000;">0</span>;<br /><span style="color: #0000FF;">RECONFIGURE</span>;<br />GO<br />&nbsp;<br /><span style="color: #008080;">---- Create our Default Profile</span><br /><span style="color: #0000FF;">DECLARE</span> @newProfileId <span style="color: #0000FF;">INT</span>;<br /><span style="color: #0000FF;">EXECUTE</span> msdb.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">sysmail_add_profile_sp</span><br />&nbsp; &nbsp; @profile_name = <span style="color: #FF0000;">'The Accidental Admin v2'</span>,<br />&nbsp; &nbsp; @description = <span style="color: #FF0000;">'A second version of the DB Admin email profile'</span>,<br />&nbsp; &nbsp; @profile_id = @newProfileId <span style="color: #0000FF;">OUTPUT</span>;<br /><span style="color: #0000FF;">PRINT</span> <span style="color: #FF0000;">'Profile Created'</span>;<br />&nbsp;<br /><span style="color: #008080;">---- Create our accounts (You did plan on a minimum of two, right?)</span><br /><span style="color: #0000FF;">DECLARE</span> @newPriAccountId <span style="color: #0000FF;">INT</span>,<br />&nbsp; &nbsp; @newSecAccountId <span style="color: #0000FF;">INT</span>;<br /><span style="color: #0000FF;">DECLARE</span> @sender <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">50</span><span style="color: #808080;">&#41;</span>;<br /><span style="color: #0000FF;">SELECT</span> @sender = <span style="color: #FF0000;">'DB SERVER - '</span> + <span style="color: #FF00FF;">@@SERVERNAME</span>;<br />&nbsp;<br /><span style="color: #008080;">-- External account using username/password</span><br /><span style="color: #0000FF;">EXECUTE</span> msdb.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">sysmail_add_account_sp</span> &nbsp;<br />&nbsp; &nbsp; @account_name = <span style="color: #FF0000;">'External DBAdmin'</span>,<br />&nbsp; &nbsp; @email_address = <span style="color: #FF0000;">'AnAccount@ExternalService.com'</span>,<br />&nbsp; &nbsp; @display_name = @sender,<br />&nbsp; &nbsp; @description = <span style="color: #FF0000;">'Primary account for DB Admin profile'</span>,<br />&nbsp; &nbsp; @mailserver_name = <span style="color: #FF0000;">'mail.ExternalService.com'</span>,<br />&nbsp; &nbsp; @username = <span style="color: #FF0000;">'username'</span>,<br />&nbsp; &nbsp; @password = <span style="color: #FF0000;">'password'</span>,<br />&nbsp; &nbsp; @account_id = @newPriAccountId <span style="color: #0000FF;">OUTPUT</span>;<br />&nbsp;<br /><span style="color: #008080;">-- Internal account using credentials from the account DB server is running under</span><br /><span style="color: #0000FF;">EXECUTE</span> msdb.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">sysmail_add_account_sp</span> &nbsp;<br />&nbsp; &nbsp; @account_name = <span style="color: #FF0000;">'Internal DBAdmin'</span>,<br />&nbsp; &nbsp; @email_address = <span style="color: #FF0000;">'YourAccount@YourDomain.com'</span>,<br />&nbsp; &nbsp; @display_name = @sender,<br />&nbsp; &nbsp; @description = <span style="color: #FF0000;">'Secondary account for DB Admin profile'</span>,<br />&nbsp; &nbsp; @mailserver_name = <span style="color: #FF0000;">'mail.YourDomain.com'</span>,<br />&nbsp; &nbsp; @use_default_credentials = <span style="color: #000;">1</span>,<br />&nbsp; &nbsp; @account_id = @newSecAccountId <span style="color: #0000FF;">OUTPUT</span>;<br />&nbsp;<br /><span style="color: #0000FF;">PRINT</span> <span style="color: #FF0000;">'Accounts Created: '</span> + @sender;<br />&nbsp;<br />&nbsp; &nbsp; <br /><span style="color: #008080;">---- Add Accounts to Profile</span><br /><span style="color: #0000FF;">EXECUTE</span> msdb.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">sysmail_add_profileaccount_sp</span><br />&nbsp; &nbsp; @profile_id = @newProfileId,<br />&nbsp; &nbsp; @account_id = @newPriAccountId,<br />&nbsp; &nbsp; @sequence_number = <span style="color: #000;">1</span>;<br />&nbsp;<br /><span style="color: #0000FF;">EXECUTE</span> msdb.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">sysmail_add_profileaccount_sp</span><br />&nbsp; &nbsp; @profile_id = @newProfileId,<br />&nbsp; &nbsp; @account_id = @newSecAccountId,<br />&nbsp; &nbsp; @sequence_number = <span style="color: #000;">2</span>;<br />&nbsp;<br /><span style="color: #0000FF;">PRINT</span> <span style="color: #FF0000;">'Accounts assigned to Profile'</span>;<br />&nbsp;<br />Go<br />&nbsp;<br /><span style="color: #008080;">---- And Then We Test</span><br /><span style="color: #008080;">-- Make sure you update the profile name with the value from above</span><br /><span style="color: #0000FF;">EXECUTE</span> msdb.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">sp_send_dbmail</span><br />&nbsp; &nbsp; @profile_name = <span style="color: #FF0000;">'The Accidental Admin v2'</span>,<br />&nbsp; &nbsp; @subject = <span style="color: #FF0000;">'Test Database Mail Message'</span>,<br />&nbsp; &nbsp; @recipients = <span style="color: #FF0000;">'You@YourDomain.Com'</span>,<br />&nbsp; &nbsp; @body = <span style="color: #FF0000;">'Test Message'</span>;<br /><span style="color: #0000FF;">PRINT</span> <span style="color: #FF0000;">'Test Email Away!'</span>;<br />&nbsp;<br />GO<br /><br /></div><div id="cb16256" style="display: none; color: red;"></div></div></div>

<p>Running this script creates a setup similar to what we created in the first section, though some of the names have been changed (and I have removed my email address from the list so I don't get server updates when someone comes along and forgets to swap out the addresses).</p>

<h2>And Now, Uses</h2>
<p>So now that we have Database Mail setup, what are we going to use it for? Well, besides creating our own monitoring and email scripts, the built in Alerts component in SQL Server uses Database mail to tell us when critical parts of our server have decided to misbehave. SQL Agent jobs have the option to notify us when they fail and they do so using, yep, Database Mail. Setting up Database Mail and using it in each of these situations won't prevent problems from occurring, but it is the difference between finding out when the problem is occurring and finding out after the server has melted down. </p>

<p>Next week will be something interesting, but I haven't determined what that will be yet, so we'll figure it out as we go.</p>

<p><style>
.mylab, .hint{
   margin: .5em 2em;
   padding: 1em 1em 1em 90px;
}
.mylab{
   border: 2px solid #CCEECC;
   background-color: #DDFFDD;
   background-image: url(http://tiernok.com/LTDBlog/mylab.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.hint{
   border: 2px solid #EEEECC;
   background-color: #FFFFDD;
   background-image: url(http://tiernok.com/LTDBlog/tip.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.screenshot{
   text-align: center;
   font-size: .8em;
   margin-bottom: 1em;
}
.acc_header{ position: relative; }
.acc_header label{ float: left; width: 150px; font-weight: bold;}
.acc_header br{  clear: left; }
.acc_header .diff{ margin-top: 3px; }
.evo_post_text dt{ width: 220px; }
.evo_post_text dd{ margin-left: 230px; }
</style></p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/virtual-lab-setting-up-database-mail-on"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/virtual-lab-setting-up-database-mail-on&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/virtual-lab-setting-up-database-mail-on">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/virtual-lab-setting-up-database-mail-on#comments</comments>
		</item>
				<item>
			<title>IF and IIF in VB.Net</title>
			<link>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/VBNET/if-and-iif</link>
			<pubDate>Wed, 23 Jun 2010 13:54:34 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="main">VB.NET</category>			<guid isPermaLink="false">884@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In continuing Chrissie's recent example of helping to point out minor (yet critical) gotchas, I now present the guarantor of a few Null Reference exceptions, &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb513985.aspx&quot; title=&quot;MSDN entry for the IF Operator&quot; target=&quot;_blank&quot;&gt;If()&lt;/a&gt; and &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.interaction.iif.aspx&quot; title=&quot;MSDN entry for the IIF Function&quot; target=&quot;_blank&quot;&gt;IIf()&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Both are designed as a way to provide VB.Net with an inline If, similar to the ternary operator found in C# and many other languages &lt;code class=&quot;codespan&quot;&gt;&amp;lt;condition&amp;gt;?&amp;lt;true-action&amp;gt;:&amp;lt;false-action&amp;gt;&lt;/code&gt;. If() and IIF() have the same signature:&lt;code class=&quot;codespan&quot;&gt; If(&amp;lt;conditional&amp;gt;,&amp;lt;true-object&amp;gt;,&amp;lt;false-object&amp;gt;)&lt;/code&gt; and &lt;code class=&quot;codespan&quot;&gt;IIF(&amp;lt;conditional&amp;gt;,&amp;lt;true-object&amp;gt;,&amp;lt;false-object&amp;gt;)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The critical difference between IIF (available from VS 2002 forward) and IF (available in VS 2005 forward) is that IIF is a function and evaluates all of its arguments prior to returning a value, while IF is an operator that executes like a short-circuiting conditional, only evaluating the true or false argument depending on the value of the conditional. &lt;/p&gt;

&lt;p&gt;Why is this important?&lt;/p&gt;
&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;vb.net&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;vb.net&quot; id=&quot;cb1741&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Dim&lt;/span&gt; myObject &lt;span style=&quot;color: #0600FF;&quot;&gt;as&lt;/span&gt; SomeObject&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Dim&lt;/span&gt; strTestOne = If&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;myObject &lt;span style=&quot;color: #0600FF;&quot;&gt;Is&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Nothing&lt;/span&gt;,&lt;span style=&quot;color: #0600FF;&quot;&gt;&amp;quot;Doesn't Exist&amp;quot;&lt;/span&gt;,myObject.&lt;span style=&quot;color: #000000;&quot;&gt;SomeProperty&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;' strTestOne now has the value &amp;quot;Doesn't Exist&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Dim&lt;/span&gt; strTestTwo = IIf&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;myObject &lt;span style=&quot;color: #0600FF;&quot;&gt;Is&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Nothing&lt;/span&gt;,&lt;span style=&quot;color: #0600FF;&quot;&gt;&amp;quot;Doesn't Exist&amp;quot;&lt;/span&gt;,myObject.&lt;span style=&quot;color: #000000;&quot;&gt;SomeProperty&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;' and this one throws a null reference because it evaluates myObject.SomeProperty prior to the conditional&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb16676&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So make sure you select the right function for your needs. In this case, selecting the wrong function can actually have the exact consequence you were trying to avoid (Null Ref).&lt;/p&gt;

&lt;p&gt;Note: Not only a whole post without pictures, but also one that is less than 10 pages. And the sky didn't start falling.&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/VBNET/if-and-iif&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/VBNET/if-and-iif&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/VBNET/if-and-iif&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<p>In continuing Chrissie's recent example of helping to point out minor (yet critical) gotchas, I now present the guarantor of a few Null Reference exceptions, <a href="http://msdn.microsoft.com/en-us/library/bb513985.aspx" title="MSDN entry for the IF Operator" target="_blank">If()</a> and <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.interaction.iif.aspx" title="MSDN entry for the IIF Function" target="_blank">IIf()</a>.</p>

<p>Both are designed as a way to provide VB.Net with an inline If, similar to the ternary operator found in C# and many other languages <code class="codespan">&lt;condition&gt;?&lt;true-action&gt;:&lt;false-action&gt;</code>. If() and IIF() have the same signature:<code class="codespan"> If(&lt;conditional&gt;,&lt;true-object&gt;,&lt;false-object&gt;)</code> and <code class="codespan">IIF(&lt;conditional&gt;,&lt;true-object&gt;,&lt;false-object&gt;)</code></p>

<p>The critical difference between IIF (available from VS 2002 forward) and IF (available in VS 2005 forward) is that IIF is a function and evaluates all of its arguments prior to returning a value, while IF is an operator that executes like a short-circuiting conditional, only evaluating the true or false argument depending on the value of the conditional. </p>

<p>Why is this important?</p>
<div class="codebox"><div class="codeheader">Code: <span>vb.net</span></div><div class="codeholder"><div class="vb.net" id="cb91523" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">Dim</span> myObject <span style="color: #0600FF;">as</span> SomeObject<br />&nbsp;<br /><span style="color: #0600FF;">Dim</span> strTestOne = If<span style="color: #000000;">&#40;</span>myObject <span style="color: #0600FF;">Is</span> <span style="color: #0600FF;">Nothing</span>,<span style="color: #0600FF;">&quot;Doesn't Exist&quot;</span>,myObject.<span style="color: #000000;">SomeProperty</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br /><span style="color: #008080; font-style: italic;">' strTestOne now has the value &quot;Doesn't Exist&quot;</span><br />&nbsp;<br /><span style="color: #0600FF;">Dim</span> strTestTwo = IIf<span style="color: #000000;">&#40;</span>myObject <span style="color: #0600FF;">Is</span> <span style="color: #0600FF;">Nothing</span>,<span style="color: #0600FF;">&quot;Doesn't Exist&quot;</span>,myObject.<span style="color: #000000;">SomeProperty</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br /><span style="color: #008080; font-style: italic;">' and this one throws a null reference because it evaluates myObject.SomeProperty prior to the conditional</span><br /><br /></div><div id="cb71346" style="display: none; color: red;"></div></div></div>

<p>So make sure you select the right function for your needs. In this case, selecting the wrong function can actually have the exact consequence you were trying to avoid (Null Ref).</p>

<p>Note: Not only a whole post without pictures, but also one that is less than 10 pages. And the sky didn't start falling.</p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/VBNET/if-and-iif"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/VBNET/if-and-iif&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/VBNET/if-and-iif">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/VBNET/if-and-iif#comments</comments>
		</item>
				<item>
			<title>Virtual Lab: 2008 R2 Domain Controller - Basic Tasks</title>
			<link>http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-2008-r2-domain-controller-ba</link>
			<pubDate>Thu, 17 Jun 2010 11:51:38 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="alt">Security</category>
<category domain="alt">Windows</category>
<category domain="main">2008 Server</category>			<guid isPermaLink="false">852@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;div class=&quot;acc_header&quot;&gt;
In the &lt;a href=&quot;http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-creating-a-2008-r2-domain-co&quot; target=&quot;_blank&quot; title=&quot;Virtual Lab: Creating a 2008 R2 Domain Controller&quot;&gt;previous article&lt;/a&gt; we covered the creation of a basic Domain Controller for our Virtual Lab. Using this basic domain controller and a basic SQL Server machine, we will look at the creation of a basic user account, creating a service account, and addition of a system to the domain.&lt;br /&gt;
&lt;br /&gt;
&lt;label&gt;Technical Area:&lt;/label&gt; Accidental Systems Administrator&lt;br /&gt;&lt;br /&gt;
&lt;label class=&quot;diff&quot;&gt;Level of Difficulty: &lt;/label&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/dr_basic.png&quot; alt=&quot;Basic Difficulty&quot; /&gt;&lt;br /&gt;
&lt;label&gt;Additional Articles:&lt;/label&gt;&lt;a href=&quot;http://wiki.lessthandot.com/index.php/Virtual_Lab&quot; title=&quot;View the wiki entry&quot;&gt;Virtual Lab entry on the LTD Wiki&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;

&lt;p&gt;This post picks up where the &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?p=845&quot;&gt;Virtual Lab: Creating a 2008 R2 Domain Controller&lt;/a&gt; post left off. Now that we have a new domain up and running we need to add some systems and users.&lt;/p&gt;

&lt;h2&gt;Creating Accounts&lt;/h2&gt;
&lt;p&gt;After installing the Active Directory Directory Services role, there are several new tools available from the Administrative Tools section of the Start menu. Throughout the remainder of the article we will be working through the &quot;Active Directory Users and Computers&quot; tool.&lt;/p&gt;

&lt;h3&gt;Domain Administrator Account&lt;/h3&gt;
&lt;p&gt;The first account we are going to create on the new domain is a Domain Administrator account. Even though this is a virtual lab environment, we don't want to get in the habit of using the built-in administrator account. &lt;/p&gt;

&lt;p&gt;Open the &quot;Active Directory User and Computers&quot; screen and explore the default groups that have been created. As this is our first visit, there are no custom folders in our tree.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/0_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/0_config.png&quot; alt=&quot;AD Users and Computers&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	AD - Users and Computers
&lt;/div&gt;

&lt;p&gt;To add a new user to the default &quot;Users&quot; folder we will right-click on the folder, select &quot;New&quot;, and select &quot;User&quot;. This provides us with a dialog to enter the basic user information.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/1_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/1_config.png&quot; alt=&quot;AD Adding a User&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	AD - Adding a User
&lt;/div&gt;

&lt;p&gt;After entering the general user information and pressing next, we are presented with a request for the user's password and password options. As we have not yet configured the password policy, the &lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc264456.aspx&quot; title=&quot;Windows 2008 Password Policy Settings&quot; target=&quot;_blank&quot;&gt;default policy&lt;/a&gt; is still in place.&lt;/p&gt;

&lt;p&gt;Completing the wizard gives us a brand new member with basic Domain User permissions.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/2_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/2_config.png&quot; alt=&quot;AD Adding a User&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	AD - Adding a User
&lt;/div&gt;

&lt;p&gt;To elevate the permissions of the user across the domain, we will assign them membership to the Domain Admins group. Open the user's properties panel (right-clicking the user and select &quot;Properties&quot;) and select the &quot;Member Of&quot; tab.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/3_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/3_config.png&quot; alt=&quot;AD Configuring a User&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	AD - Configuring a User
&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
	There are several default groups created when you install AD DS with default levels of permissions across the domain. There is a pretty good reference on the default groups available &lt;a href=&quot;http://ss64.com/nt/syntax-security_groups.html&quot; title=&quot;AD Security Groups&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.
&lt;/div&gt;

&lt;p&gt;Pressing the &quot;Add&quot; button brings up the search dialog. Enter &quot;Domain Admins&quot; and press &quot;Check Names&quot; to quickly find and select the Domain Admins group.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/4_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/4_config.png&quot; alt=&quot;AD Configuring a User&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	AD - Configuring a User
&lt;/div&gt;

&lt;p&gt;Press Ok twice and the user is now part of the Domain Admins group.&lt;/p&gt;

&lt;h3&gt;Service Accounts&lt;/h3&gt;
&lt;p&gt;Service accounts are an important part of a network. Many companies will rely on common accounts, like the built-in Administrator account, when they are setting up services on the Domain that require domain permissions. There are numerous reasons this is a bad idea:&lt;/p&gt;&lt;ul&gt;
	&lt;li&gt;Greater Impact - a change to a single user account suddenly has a much wider impact then is intended, potentially causing service outages in disparate places acros the network&lt;/li&gt;	
	&lt;li&gt;Greater Impact, Frequently - how about password changes? Using one accuont for a wide range of services requires a wider set of work when a single password has to change&lt;/li&gt;
	&lt;li&gt;Documentation - using a single account for multiple services requires either good documentation, good guessing, or a lot of overtime&lt;/li&gt;
	&lt;li&gt;Security - providing an account with too much security is a potential security hole, a virus that uses a single application as an entry point suddenly has rights to everything on the network&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In order to make management of service accounts (and services) clearer, I suggest each service account only have the level of permission on the domain it absolutely needs and that it only be used for a single service or application. This requires more work up front, as you have to not only create individual accounts for each application and service, but more importantly determine what &quot;minimum requirements&quot; means for each one. On the other hand, minimizing planned and unplanned system outages in the future is worth a little extra time.&lt;/p&gt;

&lt;div class=&quot;hint&quot;&gt;
Sometimes multiple services need access to a common resource, or a common service needs a few different permission profiles based on the use of the system (for instance, qa versus production SQL Server instances). Rather than add these permissions to each individual service account, consider creating a group that outlines the permissions and then give the service accounts membership in the group. Our goal is to minimize the number of configuration changes we will have to make when that configuration needs to change in the future.
&lt;/div&gt;

&lt;h4&gt;Creating the Service User Account&lt;/h4&gt;
&lt;p&gt;Our guinea pig in this section will be the basic SQL install from a &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?p=845&quot;&gt;previous article&lt;/a&gt;. We are going to create a service account for the database server that has limited domain permissions but local administrative permissions. We will be using a middle-of-the-road configuration to create a single user account for all SQL Server services on our domain to run unser, what I would consider to be the minimum level of implementation.&lt;/p&gt;

&lt;div class=&quot;hint&quot;&gt;
Larger networks may want to create groups to handle permissions and then create accounts for individual servers and assign them the correct group membership. This second route reduces risk but heightens the level of work necessary to manage the accounts. In this situation, I would suggest using Managed Service accounts rather than standard user accounts, as they can be assigned the same types of group permissions but reduce a portion of the overhead in administering the accounts.
&lt;/div&gt;

&lt;p&gt;On the AD DS server open the &quot;Active Directory User and Computers&quot; screen again. While there is a &quot;Users&quot; container already available in the interface, we're going to create a new Organizational Unit (OU) named &quot;Service Accounts&quot; to store these accounts.&lt;/p&gt;

&lt;p&gt;To create the new OU, we right-click the Domain (in my case &lt;em&gt;avl.local&lt;/em&gt;) and select New -&amp;gt; Organizational Unit. In the dialog we enter the name, in my case &quot;Service Accounts&quot;, and press Ok.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/5_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/5_config.png&quot; alt=&quot;Creating a new OU&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	AD - Creating a new OU
&lt;/div&gt;

&lt;p&gt;Right clicking the new &quot;Service Accounts&quot; container and selecting New &amp;gt; User opens the new user dialog.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/6_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/6_config.png&quot; alt=&quot;Creating a new Service User&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	AD - Creating a new Service User
&lt;/div&gt;

&lt;p&gt;As this is the domain account for our SQL Server services, I have chosen the name &quot;SQL Server Service Account&quot; and a username of &quot;sqladmin&quot;.&lt;/p&gt;

&lt;p&gt;On the next step we will also ensure that our password won't expire in the middle of the night by verifying the checked defaults and modifying a few.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/7_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/7_config.png&quot; alt=&quot;Creating a new Service User&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	AD - Creating a new Service User
&lt;/div&gt;

&lt;p&gt;After viewing the summary in the final step, we press Ok and create the new user. As the user is not going to have any special, domain-wide permissions we do not need to modify their group memberships or other settings. In fact we are done with the account creation until we bring our database server onto the domain and set up the local permissions for the user on that server.&lt;/p&gt;

&lt;h2&gt;Joining the Domain&lt;/h2&gt;
&lt;p&gt;Joining a server to the domain is a fairly straightforward process. In this case we will join our database server from &lt;a href=&quot;http://wiki.lessthandot.com/index.php/Virtual_Lab&quot; title=&quot;See the list of prior articles&quot; target=&quot;_blank&quot;&gt;prior articles&lt;/a&gt; and then we will configure our domain account from the previous section to serve as the administrative account for the database services.&lt;/p&gt;

&lt;p&gt;The first step will be to change the network properties of the virtual server. When we first created it we used DHCP and that means that it received a dynamic address and DNS entries other than our new controller. &lt;/p&gt;

&lt;div class=&quot;mylab&quot;&gt;
In my personal lab I am still serving DHCP requests from my core switch and have not configured it to direct DNS requests at my virtual DC because there is no guarantee that the DC will be on and later on it will be moved behind a virtual firewall and will be inaccessible to the other physical systems on my network.
&lt;/div&gt;

&lt;p&gt;On the SQL Server machine we open the network settings for our adapter, select the &quot;Internet Protocol Version 4 (TCP/IPv4)&quot; value, and press &quot;Properties&quot;. &lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/8_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/8_config.png&quot; alt=&quot;SQL Server VM - Network Settings&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Network Settings
&lt;/div&gt;

&lt;p&gt;Assign the server a static IP address on the network and point the DNS settings to the DC. At this point it would also be a good idea to check the &quot;Validate&quot; button to let Windows test the settings when you press Ok.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/9_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/9_config.png&quot; alt=&quot;SQL Server VM - Network Settings&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Network Settings
&lt;/div&gt;
&lt;p&gt;In my server the validation resulted in a message indicating that Windows couldn't identify the problem, this translates to &quot;Yes It Works&quot;.&lt;/p&gt;

&lt;p&gt;Next we will open the System Properties. &lt;/p&gt;

&lt;div class=&quot;hint&quot;&gt;
One of the 90 ways you can get to the System Properties panel is to press the &quot;Server Manager&quot; icon that is pinned to the toolbar, then in the console highlight &quot;Server manager&quot; in the left side to display the high level dashboard on the right, followed by selecting &quot;Change System Properties&quot; on the right side of that dash.
&lt;/div&gt;

&lt;p&gt;Now we want to press the &quot;Change&quot; button on the &quot;Computer Name&quot; tab. Select the &quot;Domain&quot; radio button and type in the name of the domain from your domain controller.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/10_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/10_config.png&quot; alt=&quot;SQL Server VM - Join Domain&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Join Domain
&lt;/div&gt;

&lt;p&gt;On pressing &quot;Ok&quot; we are asked to enter domain credentials with permission to join the network. &lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/11_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/11_config.png&quot; alt=&quot;SQL Server VM - Join Domain&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Join Domain
&lt;/div&gt;

&lt;p&gt;Once we enter our credentials and press &quot;Ok&quot; the system is accepted to the Domain and provides us with the customary reboot request.&lt;/p&gt;

&lt;p&gt;back on the Domain Controller in the &quot;Users and Computers&quot; console, the server has been automatically added under the &quot;Computers&quot; container. This being a simple setup, we have not created our own containers to store our servers in, so we will leave it in the default one (for now).&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/12_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/12_config.png&quot; alt=&quot;SQL Server VM - Join Domain&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Join Domain
&lt;/div&gt;

&lt;p&gt;When the SQL Server has finished rebooting we will log in for the first time with our Domain credentials. In the &quot;Server Manager&quot; we now see that the full computer name and Domain entries reflect the name of the domain.&lt;/p&gt;

&lt;h2&gt;Applying the SQL Service Account&lt;/h2&gt;
&lt;p&gt;The last step after adding a database server to the domain is to reconfigure it's services to use the domain service account we created above. This will allow us to later create domain resourcs that all of our SQL Server systems need to access without having to manage each one individually.&lt;/p&gt;

&lt;p&gt;Currently our service account has no permissions on the server, other than as a basic Domain User (and for some of you, it may not even have that level). So the first step is to provide that domain account with local administrator permissions on our database server.&lt;/p&gt;

&lt;div class=&quot;hint&quot;&gt;
Before continuing further make sure you log into the server once with the service account above. Several folders and files are created when the account logs in and not doing so (or not manually doing some trickery with the Users sub-directory and an NTLog file) appears to upset WMI when your assigning users to the services. Don't stay logged in as this user, as you will then end up battling UAC the rest of the day.
&lt;/div&gt;

&lt;p&gt;From the open &quot;Server Manager&quot; console, expand the &quot;Configuration&quot; and then &quot;Local Users and Groups&quot; containers, selecting the &quot;Groups&quot; folder. Right click the &quot;Administartors&quot; group on the right side and select &quot;Properties&quot;.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/13_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/13_config.png&quot; alt=&quot;SQL Server VM - Service Account&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Service Account
&lt;/div&gt;

&lt;p&gt;We enter the name of the domain account (in this case AVL\sqladmin) and press the &quot;Check Names&quot; button to ensure the account could be found.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/14_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/14_config.png&quot; alt=&quot;SQL Server VM - Service Account&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Service Account
&lt;/div&gt;

&lt;p&gt;Press &quot;Ok&quot; and &quot;Ok&quot; and we are back in the Server Manager again.&lt;/p&gt;

&lt;p&gt;The last step is to configure our services to use the Domain account, however this is done a little differently for SQL Server than you might expect.&lt;/p&gt;

&lt;div class=&quot;hint&quot;&gt;
While it is technically possible to change the service accounts directly from the Windows &quot;Services&quot; console, there are a number of extra steps that have to be completed in order for it to work properly, as there are also various registry and application settings that have to be set outside of the Services console. Microsoft has published a &lt;a href=&quot;http://support.microsoft.com/kb/283811&quot; title=&quot;Read the KB article&quot; target=&quot;_blank&quot;&gt;knowledge base article&lt;/a&gt; on this for 2005, I have not been able to locate a similar document for 2008.
&lt;/div&gt;

&lt;p&gt;Open the &quot;SQL Server Configuration Manager&quot; from the Start Menu (this would also be a good time to pin it to the taskbar).&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/15_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/15_config.png&quot; alt=&quot;SQL Server VM - Service Account&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Service Account
&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
Ah, the wonders of UAC. Don't get me wrong, I actually like the concept, unfortunately the implementation leaves a little to be desired in Enterprise or Domain setups. Accounts in the Domain Admins (and a few others?) groups don't receive the level of rights you would expect and, in fact, it doesn't seem possible to grant them the abilities of the built-in administrator, which has strange and mystical powers that are turned on by default and can only be turned off in the policy settings, not applied to other accounts. You will receive a number of errors when you try to escalate with a variety of different settings, and all of the recommendations [I have found] end with either turning off UAC, using the Right-Click &quot;Run As Administrator&quot;, or appear to have been written by people logged in as a Local Administrator.&lt;br /&gt;
To make matters worse, file access escalation (if it works) creates a mess of local folder permissions, so it's highly suggested that you read &lt;a href=&quot;http://blog.akinstech.com/understanding-windows-7-and-2008-r2-uac-and-permissions&quot; title=&quot;Read this post on making your own Local Admin group for file access&quot; target=&quot;_blank&quot;&gt;this workaround&lt;/a&gt;.
&lt;/div&gt;

&lt;p&gt;In the &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?p=840&quot; title=&quot;Review the Basic SQL Virtual Machine post&quot;&gt;Basic SQL Server Virtual Lab post&lt;/a&gt; we only installed a few services and configured SQL Server and SQL Agent to use a local account.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/16_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/16_config.png&quot; alt=&quot;SQL Server VM - Service Account&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Server Configuration Manager
&lt;/div&gt;

&lt;p&gt;Right-click on each service and select Properties to open the properties panel. Enter the domain account we created above in the Service Accounts section and it's password, then press Apply. The system will then warn us that a restart to the services is required to continue.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/17_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/17_config.png&quot; alt=&quot;SQL Server VM - Service Account&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Changing the Account
&lt;/div&gt;

&lt;p&gt;Follow the same instructions for each of the services and we son have all of our services running under the DOmain account.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/18_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/18_config.png&quot; alt=&quot;SQL Server VM - Service Account&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server VM - Finished
&lt;/div&gt;

&lt;h2&gt;Wrapping Up&lt;/h2&gt;
&lt;p&gt;Now that we have the Domain Controller running, we've created some accounts, and we have joined our first database server to the domain, it's time to switch focus back to our database server for a while. Upcoming weeks will focus on some administrative tasks, such as configuring database mail and alerts and building out some scripts to monitor current state and state-over-time values for a few critical performance indicators.&lt;/p&gt;

&lt;p&gt;&lt;label&gt;Additional Articles:&lt;/label&gt;&lt;a href=&quot;http://wiki.lessthandot.com/index.php/Virtual_Lab&quot; title=&quot;View the wiki entry&quot;&gt;Virtual Lab entry on the LTD Wiki&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;style&gt;
.mylab, .hint{
   margin: .5em 2em;
   padding: 1em 1em 1em 90px;
}
.mylab{
   border: 2px solid #CCEECC;
   background-color: #DDFFDD;
   background-image: url(http://tiernok.com/LTDBlog/mylab.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.hint{
   border: 2px solid #EEEECC;
   background-color: #FFFFDD;
   background-image: url(http://tiernok.com/LTDBlog/tip.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.screenshot{
   text-align: center;
   font-size: .8em;
   margin-bottom: 1em;
}
.acc_header{ position: relative; }
.acc_header label{ float: left; width: 150px; font-weight: bold;}
.acc_header br{  clear: left; }
.acc_header .diff{ margin-top: 3px; }
&lt;/style&gt;&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-2008-r2-domain-controller-ba&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-2008-r2-domain-controller-ba&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-2008-r2-domain-controller-ba&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<div class="acc_header">
In the <a href="http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-creating-a-2008-r2-domain-co" target="_blank" title="Virtual Lab: Creating a 2008 R2 Domain Controller">previous article</a> we covered the creation of a basic Domain Controller for our Virtual Lab. Using this basic domain controller and a basic SQL Server machine, we will look at the creation of a basic user account, creating a service account, and addition of a system to the domain.<br />
<br />
<label>Technical Area:</label> Accidental Systems Administrator<br /><br />
<label class="diff">Level of Difficulty: </label><img src="http://tiernok.com/LTDBlog/dr_basic.png" alt="Basic Difficulty" /><br />
<label>Additional Articles:</label><a href="http://wiki.lessthandot.com/index.php/Virtual_Lab" title="View the wiki entry">Virtual Lab entry on the LTD Wiki</a><br />
</div>

<p>This post picks up where the <a href="http://blogs.lessthandot.com/index.php/All/?p=845">Virtual Lab: Creating a 2008 R2 Domain Controller</a> post left off. Now that we have a new domain up and running we need to add some systems and users.</p>

<h2>Creating Accounts</h2>
<p>After installing the Active Directory Directory Services role, there are several new tools available from the Administrative Tools section of the Start menu. Throughout the remainder of the article we will be working through the "Active Directory Users and Computers" tool.</p>

<h3>Domain Administrator Account</h3>
<p>The first account we are going to create on the new domain is a Domain Administrator account. Even though this is a virtual lab environment, we don't want to get in the habit of using the built-in administrator account. </p>

<p>Open the "Active Directory User and Computers" screen and explore the default groups that have been created. As this is our first visit, there are no custom folders in our tree.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/0_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/0_config.png" alt="AD Users and Computers" /></a><br />
	AD - Users and Computers
</div>

<p>To add a new user to the default "Users" folder we will right-click on the folder, select "New", and select "User". This provides us with a dialog to enter the basic user information.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/1_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/1_config.png" alt="AD Adding a User" /></a><br />
	AD - Adding a User
</div>

<p>After entering the general user information and pressing next, we are presented with a request for the user's password and password options. As we have not yet configured the password policy, the <a href="http://technet.microsoft.com/en-us/library/cc264456.aspx" title="Windows 2008 Password Policy Settings" target="_blank">default policy</a> is still in place.</p>

<p>Completing the wizard gives us a brand new member with basic Domain User permissions.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/2_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/2_config.png" alt="AD Adding a User" /></a><br />
	AD - Adding a User
</div>

<p>To elevate the permissions of the user across the domain, we will assign them membership to the Domain Admins group. Open the user's properties panel (right-clicking the user and select "Properties") and select the "Member Of" tab.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/3_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/3_config.png" alt="AD Configuring a User" /></a><br />
	AD - Configuring a User
</div>

<div class="hint">
	There are several default groups created when you install AD DS with default levels of permissions across the domain. There is a pretty good reference on the default groups available <a href="http://ss64.com/nt/syntax-security_groups.html" title="AD Security Groups" target="_blank">here</a>.
</div>

<p>Pressing the "Add" button brings up the search dialog. Enter "Domain Admins" and press "Check Names" to quickly find and select the Domain Admins group.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/4_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/4_config.png" alt="AD Configuring a User" /></a><br />
	AD - Configuring a User
</div>

<p>Press Ok twice and the user is now part of the Domain Admins group.</p>

<h3>Service Accounts</h3>
<p>Service accounts are an important part of a network. Many companies will rely on common accounts, like the built-in Administrator account, when they are setting up services on the Domain that require domain permissions. There are numerous reasons this is a bad idea:</p><ul>
	<li>Greater Impact - a change to a single user account suddenly has a much wider impact then is intended, potentially causing service outages in disparate places acros the network</li>	
	<li>Greater Impact, Frequently - how about password changes? Using one accuont for a wide range of services requires a wider set of work when a single password has to change</li>
	<li>Documentation - using a single account for multiple services requires either good documentation, good guessing, or a lot of overtime</li>
	<li>Security - providing an account with too much security is a potential security hole, a virus that uses a single application as an entry point suddenly has rights to everything on the network</li>
</ul>

<p>In order to make management of service accounts (and services) clearer, I suggest each service account only have the level of permission on the domain it absolutely needs and that it only be used for a single service or application. This requires more work up front, as you have to not only create individual accounts for each application and service, but more importantly determine what "minimum requirements" means for each one. On the other hand, minimizing planned and unplanned system outages in the future is worth a little extra time.</p>

<div class="hint">
Sometimes multiple services need access to a common resource, or a common service needs a few different permission profiles based on the use of the system (for instance, qa versus production SQL Server instances). Rather than add these permissions to each individual service account, consider creating a group that outlines the permissions and then give the service accounts membership in the group. Our goal is to minimize the number of configuration changes we will have to make when that configuration needs to change in the future.
</div>

<h4>Creating the Service User Account</h4>
<p>Our guinea pig in this section will be the basic SQL install from a <a href="http://blogs.lessthandot.com/index.php/All/?p=845">previous article</a>. We are going to create a service account for the database server that has limited domain permissions but local administrative permissions. We will be using a middle-of-the-road configuration to create a single user account for all SQL Server services on our domain to run unser, what I would consider to be the minimum level of implementation.</p>

<div class="hint">
Larger networks may want to create groups to handle permissions and then create accounts for individual servers and assign them the correct group membership. This second route reduces risk but heightens the level of work necessary to manage the accounts. In this situation, I would suggest using Managed Service accounts rather than standard user accounts, as they can be assigned the same types of group permissions but reduce a portion of the overhead in administering the accounts.
</div>

<p>On the AD DS server open the "Active Directory User and Computers" screen again. While there is a "Users" container already available in the interface, we're going to create a new Organizational Unit (OU) named "Service Accounts" to store these accounts.</p>

<p>To create the new OU, we right-click the Domain (in my case <em>avl.local</em>) and select New -&gt; Organizational Unit. In the dialog we enter the name, in my case "Service Accounts", and press Ok.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/5_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/5_config.png" alt="Creating a new OU" /></a><br />
	AD - Creating a new OU
</div>

<p>Right clicking the new "Service Accounts" container and selecting New &gt; User opens the new user dialog.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/6_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/6_config.png" alt="Creating a new Service User" /></a><br />
	AD - Creating a new Service User
</div>

<p>As this is the domain account for our SQL Server services, I have chosen the name "SQL Server Service Account" and a username of "sqladmin".</p>

<p>On the next step we will also ensure that our password won't expire in the middle of the night by verifying the checked defaults and modifying a few.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/7_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/7_config.png" alt="Creating a new Service User" /></a><br />
	AD - Creating a new Service User
</div>

<p>After viewing the summary in the final step, we press Ok and create the new user. As the user is not going to have any special, domain-wide permissions we do not need to modify their group memberships or other settings. In fact we are done with the account creation until we bring our database server onto the domain and set up the local permissions for the user on that server.</p>

<h2>Joining the Domain</h2>
<p>Joining a server to the domain is a fairly straightforward process. In this case we will join our database server from <a href="http://wiki.lessthandot.com/index.php/Virtual_Lab" title="See the list of prior articles" target="_blank">prior articles</a> and then we will configure our domain account from the previous section to serve as the administrative account for the database services.</p>

<p>The first step will be to change the network properties of the virtual server. When we first created it we used DHCP and that means that it received a dynamic address and DNS entries other than our new controller. </p>

<div class="mylab">
In my personal lab I am still serving DHCP requests from my core switch and have not configured it to direct DNS requests at my virtual DC because there is no guarantee that the DC will be on and later on it will be moved behind a virtual firewall and will be inaccessible to the other physical systems on my network.
</div>

<p>On the SQL Server machine we open the network settings for our adapter, select the "Internet Protocol Version 4 (TCP/IPv4)" value, and press "Properties". </p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/8_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/8_config.png" alt="SQL Server VM - Network Settings" /></a><br />
	SQL Server VM - Network Settings
</div>

<p>Assign the server a static IP address on the network and point the DNS settings to the DC. At this point it would also be a good idea to check the "Validate" button to let Windows test the settings when you press Ok.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/9_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/9_config.png" alt="SQL Server VM - Network Settings" /></a><br />
	SQL Server VM - Network Settings
</div>
<p>In my server the validation resulted in a message indicating that Windows couldn't identify the problem, this translates to "Yes It Works".</p>

<p>Next we will open the System Properties. </p>

<div class="hint">
One of the 90 ways you can get to the System Properties panel is to press the "Server Manager" icon that is pinned to the toolbar, then in the console highlight "Server manager" in the left side to display the high level dashboard on the right, followed by selecting "Change System Properties" on the right side of that dash.
</div>

<p>Now we want to press the "Change" button on the "Computer Name" tab. Select the "Domain" radio button and type in the name of the domain from your domain controller.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/10_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/10_config.png" alt="SQL Server VM - Join Domain" /></a><br />
	SQL Server VM - Join Domain
</div>

<p>On pressing "Ok" we are asked to enter domain credentials with permission to join the network. </p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/11_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/11_config.png" alt="SQL Server VM - Join Domain" /></a><br />
	SQL Server VM - Join Domain
</div>

<p>Once we enter our credentials and press "Ok" the system is accepted to the Domain and provides us with the customary reboot request.</p>

<p>back on the Domain Controller in the "Users and Computers" console, the server has been automatically added under the "Computers" container. This being a simple setup, we have not created our own containers to store our servers in, so we will leave it in the default one (for now).</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/12_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/12_config.png" alt="SQL Server VM - Join Domain" /></a><br />
	SQL Server VM - Join Domain
</div>

<p>When the SQL Server has finished rebooting we will log in for the first time with our Domain credentials. In the "Server Manager" we now see that the full computer name and Domain entries reflect the name of the domain.</p>

<h2>Applying the SQL Service Account</h2>
<p>The last step after adding a database server to the domain is to reconfigure it's services to use the domain service account we created above. This will allow us to later create domain resourcs that all of our SQL Server systems need to access without having to manage each one individually.</p>

<p>Currently our service account has no permissions on the server, other than as a basic Domain User (and for some of you, it may not even have that level). So the first step is to provide that domain account with local administrator permissions on our database server.</p>

<div class="hint">
Before continuing further make sure you log into the server once with the service account above. Several folders and files are created when the account logs in and not doing so (or not manually doing some trickery with the Users sub-directory and an NTLog file) appears to upset WMI when your assigning users to the services. Don't stay logged in as this user, as you will then end up battling UAC the rest of the day.
</div>

<p>From the open "Server Manager" console, expand the "Configuration" and then "Local Users and Groups" containers, selecting the "Groups" folder. Right click the "Administartors" group on the right side and select "Properties".</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/13_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/13_config.png" alt="SQL Server VM - Service Account" /></a><br />
	SQL Server VM - Service Account
</div>

<p>We enter the name of the domain account (in this case AVL\sqladmin) and press the "Check Names" button to ensure the account could be found.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/14_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/14_config.png" alt="SQL Server VM - Service Account" /></a><br />
	SQL Server VM - Service Account
</div>

<p>Press "Ok" and "Ok" and we are back in the Server Manager again.</p>

<p>The last step is to configure our services to use the Domain account, however this is done a little differently for SQL Server than you might expect.</p>

<div class="hint">
While it is technically possible to change the service accounts directly from the Windows "Services" console, there are a number of extra steps that have to be completed in order for it to work properly, as there are also various registry and application settings that have to be set outside of the Services console. Microsoft has published a <a href="http://support.microsoft.com/kb/283811" title="Read the KB article" target="_blank">knowledge base article</a> on this for 2005, I have not been able to locate a similar document for 2008.
</div>

<p>Open the "SQL Server Configuration Manager" from the Start Menu (this would also be a good time to pin it to the taskbar).</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/15_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/15_config.png" alt="SQL Server VM - Service Account" /></a><br />
	SQL Server VM - Service Account
</div>

<div class="hint">
Ah, the wonders of UAC. Don't get me wrong, I actually like the concept, unfortunately the implementation leaves a little to be desired in Enterprise or Domain setups. Accounts in the Domain Admins (and a few others?) groups don't receive the level of rights you would expect and, in fact, it doesn't seem possible to grant them the abilities of the built-in administrator, which has strange and mystical powers that are turned on by default and can only be turned off in the policy settings, not applied to other accounts. You will receive a number of errors when you try to escalate with a variety of different settings, and all of the recommendations [I have found] end with either turning off UAC, using the Right-Click "Run As Administrator", or appear to have been written by people logged in as a Local Administrator.<br />
To make matters worse, file access escalation (if it works) creates a mess of local folder permissions, so it's highly suggested that you read <a href="http://blog.akinstech.com/understanding-windows-7-and-2008-r2-uac-and-permissions" title="Read this post on making your own Local Admin group for file access" target="_blank">this workaround</a>.
</div>

<p>In the <a href="http://blogs.lessthandot.com/index.php/All/?p=840" title="Review the Basic SQL Virtual Machine post">Basic SQL Server Virtual Lab post</a> we only installed a few services and configured SQL Server and SQL Agent to use a local account.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/16_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/16_config.png" alt="SQL Server VM - Service Account" /></a><br />
	SQL Server VM - Server Configuration Manager
</div>

<p>Right-click on each service and select Properties to open the properties panel. Enter the domain account we created above in the Service Accounts section and it's password, then press Apply. The system will then warn us that a restart to the services is required to continue.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/17_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/17_config.png" alt="SQL Server VM - Service Account" /></a><br />
	SQL Server VM - Changing the Account
</div>

<p>Follow the same instructions for each of the services and we son have all of our services running under the DOmain account.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/18_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/18_config.png" alt="SQL Server VM - Service Account" /></a><br />
	SQL Server VM - Finished
</div>

<h2>Wrapping Up</h2>
<p>Now that we have the Domain Controller running, we've created some accounts, and we have joined our first database server to the domain, it's time to switch focus back to our database server for a while. Upcoming weeks will focus on some administrative tasks, such as configuring database mail and alerts and building out some scripts to monitor current state and state-over-time values for a few critical performance indicators.</p>

<p><label>Additional Articles:</label><a href="http://wiki.lessthandot.com/index.php/Virtual_Lab" title="View the wiki entry">Virtual Lab entry on the LTD Wiki</a><br /></p>

<p><style>
.mylab, .hint{
   margin: .5em 2em;
   padding: 1em 1em 1em 90px;
}
.mylab{
   border: 2px solid #CCEECC;
   background-color: #DDFFDD;
   background-image: url(http://tiernok.com/LTDBlog/mylab.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.hint{
   border: 2px solid #EEEECC;
   background-color: #FFFFDD;
   background-image: url(http://tiernok.com/LTDBlog/tip.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.screenshot{
   text-align: center;
   font-size: .8em;
   margin-bottom: 1em;
}
.acc_header{ position: relative; }
.acc_header label{ float: left; width: 150px; font-weight: bold;}
.acc_header br{  clear: left; }
.acc_header .diff{ margin-top: 3px; }
</style></p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-2008-r2-domain-controller-ba"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-2008-r2-domain-controller-ba&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-2008-r2-domain-controller-ba">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-2008-r2-domain-controller-ba#comments</comments>
		</item>
				<item>
			<title>Virtual Lab: Creating a 2008 R2 Domain Controller</title>
			<link>http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-creating-a-2008-r2-domain-co</link>
			<pubDate>Fri, 28 May 2010 18:38:15 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="alt">Windows</category>
<category domain="main">2008 Server</category>			<guid isPermaLink="false">845@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;div class=&quot;acc_header&quot;&gt;
A virtual domain controller (DC) can be both a powerful and lightweight addition to your virtual lab. A central AD implementation not only gives you another set of services to work with, it also provides a more realistic environment with the power of domain accounts and policies that will be useful when you start working with multi-server setups. This article will walk through the creation of a basic 2008 R2 Domain Controller.&lt;br /&gt;
&lt;br /&gt;
&lt;label&gt;Technical Area:&lt;/label&gt; Accidental Systems Administrator&lt;br /&gt;&lt;br /&gt;
&lt;label class=&quot;diff&quot;&gt;Level of Difficulty: &lt;/label&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/dr_basic.png&quot; alt=&quot;Basic Difficulty&quot; /&gt;&lt;br /&gt;
&lt;label&gt;Additional Articles:&lt;/label&gt;&lt;a href=&quot;http://wiki.lessthandot.com/index.php/Virtual_Lab&quot; title=&quot;View the wiki entry&quot;&gt;Virtual Lab entry on the LTD Wiki&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h2&gt;Terminology&lt;/h2&gt;
&lt;p&gt;There are some terms that are commonly used in relation to AD or a Domain Controller that will appear in this and other documents:&lt;/p&gt;
&lt;dl&gt;
	&lt;dt&gt;Domain Controller&lt;/dt&gt;&lt;dd&gt;The server or servers responsible for handling authentication and informational requests for users/systems on the domain&lt;/dd&gt;&lt;br /&gt;
	&lt;dt&gt;Forest&lt;/dt&gt;&lt;dd&gt;Domains are represented as trees of directory information, a forest is the group of all trees in the organization&lt;/dd&gt;&lt;br /&gt;
	&lt;dt&gt;Kerberos&lt;/dt&gt;&lt;dd&gt;Kerberos is an authentication protocol used to allow systems on an un-trusted network a method to prove their identity to one another&lt;/dd&gt;&lt;br /&gt;
	&lt;dt&gt;FQDN&lt;/dt&gt;&lt;dd&gt;Fully Qualified Domain Name - the fully spelled out domain name for a domain, for example mydomain.com&lt;/dd&gt;
&lt;/dl&gt;

&lt;div class=&quot;hint&quot;&gt;
There has been a critical change to this article due to a new piece of information that I didn't previously know. Rather than use the base windows image as the DC for your lab you should go ahead and install this machine from scratch to ensure it doesn't have a duplicate SID. In prior versions we could (sort-of) change a SID but that's not really the case anymore. This is really only a big deal for the DC because the SIDs for users from the DC (domain accounts) need to not match SIDs for local users/groups/etc.&lt;br /&gt;
More details can around duplicate SIDs, 2008 R2, and similar topics are available in &lt;a href=&quot;http://blogs.technet.com/b/markrussinovich/archive/2009/11/03/3291024.aspx&quot; target=&quot;_blank&quot;&gt;this article from Mark Russinovich&lt;/a&gt;.
&lt;/div&gt;

&lt;h2&gt;Setting up VM&lt;/h2&gt;
&lt;p&gt;First we need to create a virtual machine to house the future domain controller (DC). In the &lt;a href=&quot;http://blogs.lessthandot.com/index.php/SysAdmins/OS/building-the-virtual-lab-vmware-and-2008&quot; title=&quot;Building the Virtual Lab: VMWare and MS Windows 2008 R2&quot;&gt;first article&lt;/a&gt; we walked through the process of creating a basic VM. We will follow those same steps to create the VM for our DC except once we have Windows installed we will customize it further than we did with the original VM.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/0_AddVirtualMachine.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/0_AddVirtualMachine.png&quot; alt=&quot;Add Virtual Machine, Step 0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Creating the Virtual Machine
&lt;/div&gt;

&lt;p&gt;For the time being this system is going to be connected to the Host via the existing Bridged connection. At a later point in time we will look at creating virtual networks in VMWare and build out a more defined network. &lt;/p&gt;

&lt;div class=&quot;mylab&quot;&gt;
	Because I don't intend on having a heavy workload on this server or installing any additional services beyond AD and DNS, I have only allocated 512MB of memory to the server. If it becomes noticeably sluggish servicing my tiny domain then I will bump it up to 1024.
&lt;/div&gt;

&lt;h2&gt;Configuring the OS&lt;/h2&gt;
&lt;p&gt;Once the virtual machine is created, configured in VMWare, and Windows has been installed, it's time to move on to the Windows configuration. Some of these will be the same as our prior article and several will be new additions to prep the server for Active Directory.&lt;/p&gt;

&lt;p&gt;First we will want to configure the server name and then assign it a new static IP Address on the local network.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/1_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/1_startup.png&quot; alt=&quot;Changing the System Name&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Changing the System Name
&lt;/div&gt;

&lt;p&gt;After changing the name we'll open the network settings by either selecting the &quot;Configure Networking&quot; link on the Initial Configuration dashboard (above) or clicking the network icon in the tool tray at the bottom right, followed by &quot;Open Network and Sharing&quot;, and then &quot;Change adapter settings&quot; near the top right of the screen. With the &quot;Network Connections&quot; screen open we can right click the network adapter and enter the &quot;Properties&quot; pane. Select the &quot;Internet Protocol Version 4&quot; item from the list and press properties to access the IP configuration panel. &lt;/p&gt;

&lt;p&gt;At this point we need to select a static IP address that isn't already in use on our network and isn't in the DHCP range for our network. After selecting an IP Address we enter the static IP address, enter the gateway server or switches address, and then enter the servers address as the primary DNS entry and our switch or external DNS as the secondary one.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/2_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/2_startup.png&quot; alt=&quot;Configuring the IP Address&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Configuring the IP Address
&lt;/div&gt;

&lt;div class=&quot;mylab&quot;&gt;
	My home network has defined ranges and already has a DNS server, so these servers will all receive addresses in the 51-99 range and they will have the non-virtual DNS server listed as a secondary DNS.
&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
It is possible to install Active Directory and the DNS server on a system without a static IP address and trust that it will assign itself the same address over time, but I don't recommend it as your clients will eventually not be able to find their DNS server and than pain and suffering will ensue. 
&lt;/div&gt;

&lt;p&gt;The last step to preparing your server for Active Directory is planning. In a non-lab installation we would want to put some forethought into how many clients we intend to support with Directory Services, whether there will be secondary DCs on the network, etc. I have an older link for &lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc739022%28WS.10%29.aspx&quot; title=&quot;Assess Hardware for AD on Windows 2003&quot;&gt;capacity planning for AD on Windows 2003&lt;/a&gt;, but unfortunately I have not been able to find a comparable article for 2008 yet.&lt;/p&gt;

&lt;h2&gt;Installing Active Directory&lt;/h2&gt;
&lt;p&gt;In Windows 2008, Active Directory has expanded to take on a wider range of roles and capabilities. The portion we formerly considered to be AD, directory management and communications, is now called Active Directory Domain Services (AD DS). Other services include Active Directory Certificate Services (AD CS), Active Directory Federation Services (AD FS), Active Directory Lightweight Directory Services (AD LDS), and Active Directory Rights Management Services (AD RMS). Today we will be concentrating on AD DS, though I will continue to refer to as AD throughout the rest of the post due to bad habits and years of practice.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/0_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/0_setup.png&quot; alt=&quot;Assigning Server Roles&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Assigning Server Roles
&lt;/div&gt;

&lt;p&gt;To start the installation and setup process, we will refer back to the Initial Configuration dashboard (click the pinned shortcut on the taskbar if you closed it already). Under section 3 there is a &quot;Roles&quot; category that will allow us to easily assign the necessary roles to our server.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/1_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/1_setup.png&quot; alt=&quot;Assigning Server Roles&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Assigning Server Roles
&lt;/div&gt;

&lt;h3&gt;Installing the Active Directory Role&lt;/h3&gt;

&lt;p&gt;The first page of the &quot;Add Roles Wizard&quot; presents us with some friendly reminders to set a static IP Address (check), ensure the Administrator account has a strong password (check), and make sure the server is up to date on Windows Updates (check). &lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/2_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/2_setup.png&quot; alt=&quot;Assigning Server Roles&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Assigning Server Roles
&lt;/div&gt;

&lt;p&gt;Next we move on to the Roles selection page. As promised, we see a number of active directory services listed, the option for today being AD DS.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/3_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/3_setup.png&quot; alt=&quot;Installing AD DS&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Installing AD DS
&lt;/div&gt;

&lt;p&gt;On selecting the AD DS option the wizard runs a quick validation and notices that our server does not appear to have a necessary component, in this case .Net Framework 3.5. &lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/4_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/4_setup.png&quot; alt=&quot;Installing AD DS&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Installing AD DS - Prerequisites
&lt;/div&gt;

&lt;p&gt;After choosing to install the prerequisite (a difficult and time consuming decision, or perhaps not) and pressing next on the main screen, we are provided with a list of &quot;Things to Note&quot; as well as links to additional information, saving me the time of writing and linking them up myself.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/5_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/5_setup.png&quot; alt=&quot;Installing AD DS&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Installing AD DS - Things to Note
&lt;/div&gt;

&lt;p&gt;A short confirmation displays the items we are installing, including the noted prerequisite above and a reminder that directory services won't truly be functional until we run &quot;dcpromo&quot;.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/6_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/6_setup.png&quot; alt=&quot;Installing AD DS&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Installing AD DS - Confirmation
&lt;/div&gt;

&lt;p&gt;After the installation and verification is complete, we are presented a handy link to launch dcpromo.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/7_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/7_setup.png&quot; alt=&quot;Installing AD DS&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Installing AD DS - Wizard Complete
&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
	If you accidentally close the window before pressing the link or need to access dcpromo later, the start menu's run input will recognize &quot;dcpromo&quot; and find the requisite shortcut for you.
&lt;/div&gt;

&lt;h3&gt;AD DS Installation Wizard (DCPromo)&lt;/h3&gt;
&lt;p&gt;The dcpromo wizard will complete the installation of AD DS on the server. &lt;/p&gt;

&lt;p&gt;On the first step we are presented with the option to &quot;Use Advanced Mode Setup&quot;. This option will cause several additional wizard windows to appear throughout the process that would have defaulted behind the scenes if it were not checked. Press the &quot;advanced mode installation&quot; hyperlink to get a help document about the additional options presented in advanced mode.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/7_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/7_setup.png&quot; alt=&quot;DCPromo&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DCPromo - Beginning
&lt;/div&gt;

&lt;p&gt;After an informational screen about the suggested cryptography option and systems that may not support it, we are presented with the option to add a domain to an existing forest or to create a new domain under a new forest. This being our first DC in the virtual lab, we will be creating a new forest for our domain.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/8_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/8_setup.png&quot; alt=&quot;DCPromo&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DCPromo - New Forest and Domain
&lt;/div&gt;

&lt;p&gt;Next type the fully qualified domain name (FQDN) for your domain. After typing this name the wizard will then scan to ensure the name is not already in use.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/9_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/9_setup.png&quot; alt=&quot;DCPromo&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DCPromo - FQDN Entry
&lt;/div&gt;

&lt;p&gt;The wizard then prompts us to enter a Domain NetBIOS name, with a suggestion based on the name from the prior step.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/10_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/10_setup.png&quot; alt=&quot;DCPromo&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DCPromo - NetBIOS Name
&lt;/div&gt;

&lt;p&gt;Next we'll set the functional level of our forest. The functional level defines the maximum level (and feature set) that our forest will support. When installing additional DCs in an existing forest or creating a business domain that you intend to support over the next ten years, this needs to be a well thought out decision. When installing in a virtual lab we will of course pick the highest possible level in less time than it took to write this paragraph.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/11_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/11_setup.png&quot; alt=&quot;DCPromo&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DCPromo - Functional Level
&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
	One of the best reasons for using 2008 R2 mode is the new &quot;Recycle Bin&quot; option. This option keeps deleted entries in memory and provides an option to restore them, providing a bit of a safety net and reducing the potential for having to use the AD Recovery Mode to recover a deleted set of accounts or objects.
&lt;/div&gt;
&lt;div class=&quot;mylab&quot;&gt;
Actually the Recycle Bin option worries me. I like admins (and myself) to be a little scared of their tools and nothing says scared like remembering that time you accidentally deleted something and spent recovering it manually. Oh well.
&lt;/div&gt;

&lt;p&gt;After another quick scan of the network will tell us if DNS is available and supports the necessary capabilities for the domain controller. In this case, since we are installing a primary DC, I'm going to suggest we install DNS on the same server.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/12_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/12_setup.png&quot; alt=&quot;DCPromo&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DCPromo - DNS
&lt;/div&gt;

&lt;p&gt;After selecting to install the DNS server we receive a warning that a delegation for the DNS server cannot be created because the authoritative parent zone for the domain name I entered earlier could not be found. Translated, this means that the server went looking for an authoritative DNS entry for the &lt;i&gt;avl.local&lt;/i&gt; domain name I entered and determined that no one had ever heard of it. Since we are just now installing the DNS server that will recognize that name, this is to be expected and can be safely ignored. &lt;/p&gt;

&lt;p&gt;The next step is to provide a location for the database and files that will be used by AD DS. In a non-lab setup this needs to be carefully planned to ensure enough capacity is available ahead of time. This being a virtual lab, we will be accepting the defaults and allowing it to carve out space from the primary drive.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/13_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/13_setup.png&quot; alt=&quot;DCPromo&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DCPromo - Database and File Locations
&lt;/div&gt;

&lt;p&gt;The Directory Services Restore password is used only when major restoration activities need to be undertaken. After entering the password we will add it to our password safe so it won't be forgotten. This password will hopefully never be needed (especially in a lab environment), but not writing it down will pretty much ensure our first, future restoration step will be getting past the lack of a password.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/14_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/14_setup.png&quot; alt=&quot;DCPromo&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DCPromo - Restore Password
&lt;/div&gt;

&lt;p&gt;After a brief summary of the selected configurations and the option to export these settings for an unattended installation, we are ready to let the server start installing.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/15_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/15_setup.png&quot; alt=&quot;DCPromo&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	DCPromo - Installing
&lt;/div&gt;
&lt;p&gt;The installer wraps up with the common Finish screen and a request to reboot.&lt;/p&gt;

&lt;p&gt;After rebooting, our &quot;Initial Configuration Tasks&quot; window confirms our new roles have been installed. &lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/BasicDC/16_setup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/BasicDC/16_setup.png&quot; alt=&quot;DCPromo&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Initial Configuration Tasks - Roles
&lt;/div&gt;

&lt;h2&gt;Managing the Domain&lt;/h2&gt;
&lt;p&gt;Our next post will cover basic administration topics for the domain, as we add our first SQL Server system to the domain, create a new administrative user, and create a service account for our SQL Server services.&lt;/p&gt;

&lt;p&gt;&lt;label&gt;Additional Articles:&lt;/label&gt;&lt;a href=&quot;http://wiki.lessthandot.com/index.php/Virtual_Lab&quot; title=&quot;View the wiki entry&quot;&gt;Virtual Lab entry on the LTD Wiki&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;style&gt;
.mylab, .hint{
   margin: .5em 2em;
   padding: 1em 1em 1em 90px;
}
.mylab{
   border: 2px solid #CCEECC;
   background-color: #DDFFDD;
   background-image: url(http://tiernok.com/LTDBlog/mylab.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.hint{
   border: 2px solid #EEEECC;
   background-color: #FFFFDD;
   background-image: url(http://tiernok.com/LTDBlog/tip.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.screenshot{
   text-align: center;
   font-size: .8em;
   margin-bottom: 1em;
}
.acc_header{ position: relative; }
.acc_header label{ float: left; width: 150px; font-weight: bold;}
.acc_header br{  clear: left; }
.acc_header .diff{ margin-top: 3px; }
&lt;/style&gt;&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-creating-a-2008-r2-domain-co&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-creating-a-2008-r2-domain-co&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-creating-a-2008-r2-domain-co&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<div class="acc_header">
A virtual domain controller (DC) can be both a powerful and lightweight addition to your virtual lab. A central AD implementation not only gives you another set of services to work with, it also provides a more realistic environment with the power of domain accounts and policies that will be useful when you start working with multi-server setups. This article will walk through the creation of a basic 2008 R2 Domain Controller.<br />
<br />
<label>Technical Area:</label> Accidental Systems Administrator<br /><br />
<label class="diff">Level of Difficulty: </label><img src="http://tiernok.com/LTDBlog/dr_basic.png" alt="Basic Difficulty" /><br />
<label>Additional Articles:</label><a href="http://wiki.lessthandot.com/index.php/Virtual_Lab" title="View the wiki entry">Virtual Lab entry on the LTD Wiki</a><br />
</div>
<p><br /></p>
<h2>Terminology</h2>
<p>There are some terms that are commonly used in relation to AD or a Domain Controller that will appear in this and other documents:</p>
<dl>
	<dt>Domain Controller</dt><dd>The server or servers responsible for handling authentication and informational requests for users/systems on the domain</dd><br />
	<dt>Forest</dt><dd>Domains are represented as trees of directory information, a forest is the group of all trees in the organization</dd><br />
	<dt>Kerberos</dt><dd>Kerberos is an authentication protocol used to allow systems on an un-trusted network a method to prove their identity to one another</dd><br />
	<dt>FQDN</dt><dd>Fully Qualified Domain Name - the fully spelled out domain name for a domain, for example mydomain.com</dd>
</dl>

<div class="hint">
There has been a critical change to this article due to a new piece of information that I didn't previously know. Rather than use the base windows image as the DC for your lab you should go ahead and install this machine from scratch to ensure it doesn't have a duplicate SID. In prior versions we could (sort-of) change a SID but that's not really the case anymore. This is really only a big deal for the DC because the SIDs for users from the DC (domain accounts) need to not match SIDs for local users/groups/etc.<br />
More details can around duplicate SIDs, 2008 R2, and similar topics are available in <a href="http://blogs.technet.com/b/markrussinovich/archive/2009/11/03/3291024.aspx" target="_blank">this article from Mark Russinovich</a>.
</div>

<h2>Setting up VM</h2>
<p>First we need to create a virtual machine to house the future domain controller (DC). In the <a href="http://blogs.lessthandot.com/index.php/SysAdmins/OS/building-the-virtual-lab-vmware-and-2008" title="Building the Virtual Lab: VMWare and MS Windows 2008 R2">first article</a> we walked through the process of creating a basic VM. We will follow those same steps to create the VM for our DC except once we have Windows installed we will customize it further than we did with the original VM.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/0_AddVirtualMachine.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/0_AddVirtualMachine.png" alt="Add Virtual Machine, Step 0" /></a><br />
	Creating the Virtual Machine
</div>

<p>For the time being this system is going to be connected to the Host via the existing Bridged connection. At a later point in time we will look at creating virtual networks in VMWare and build out a more defined network. </p>

<div class="mylab">
	Because I don't intend on having a heavy workload on this server or installing any additional services beyond AD and DNS, I have only allocated 512MB of memory to the server. If it becomes noticeably sluggish servicing my tiny domain then I will bump it up to 1024.
</div>

<h2>Configuring the OS</h2>
<p>Once the virtual machine is created, configured in VMWare, and Windows has been installed, it's time to move on to the Windows configuration. Some of these will be the same as our prior article and several will be new additions to prep the server for Active Directory.</p>

<p>First we will want to configure the server name and then assign it a new static IP Address on the local network.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/1_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/1_startup.png" alt="Changing the System Name" /></a><br />
	Changing the System Name
</div>

<p>After changing the name we'll open the network settings by either selecting the "Configure Networking" link on the Initial Configuration dashboard (above) or clicking the network icon in the tool tray at the bottom right, followed by "Open Network and Sharing", and then "Change adapter settings" near the top right of the screen. With the "Network Connections" screen open we can right click the network adapter and enter the "Properties" pane. Select the "Internet Protocol Version 4" item from the list and press properties to access the IP configuration panel. </p>

<p>At this point we need to select a static IP address that isn't already in use on our network and isn't in the DHCP range for our network. After selecting an IP Address we enter the static IP address, enter the gateway server or switches address, and then enter the servers address as the primary DNS entry and our switch or external DNS as the secondary one.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/2_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/2_startup.png" alt="Configuring the IP Address" /></a><br />
	Configuring the IP Address
</div>

<div class="mylab">
	My home network has defined ranges and already has a DNS server, so these servers will all receive addresses in the 51-99 range and they will have the non-virtual DNS server listed as a secondary DNS.
</div>

<div class="hint">
It is possible to install Active Directory and the DNS server on a system without a static IP address and trust that it will assign itself the same address over time, but I don't recommend it as your clients will eventually not be able to find their DNS server and than pain and suffering will ensue. 
</div>

<p>The last step to preparing your server for Active Directory is planning. In a non-lab installation we would want to put some forethought into how many clients we intend to support with Directory Services, whether there will be secondary DCs on the network, etc. I have an older link for <a href="http://technet.microsoft.com/en-us/library/cc739022%28WS.10%29.aspx" title="Assess Hardware for AD on Windows 2003">capacity planning for AD on Windows 2003</a>, but unfortunately I have not been able to find a comparable article for 2008 yet.</p>

<h2>Installing Active Directory</h2>
<p>In Windows 2008, Active Directory has expanded to take on a wider range of roles and capabilities. The portion we formerly considered to be AD, directory management and communications, is now called Active Directory Domain Services (AD DS). Other services include Active Directory Certificate Services (AD CS), Active Directory Federation Services (AD FS), Active Directory Lightweight Directory Services (AD LDS), and Active Directory Rights Management Services (AD RMS). Today we will be concentrating on AD DS, though I will continue to refer to as AD throughout the rest of the post due to bad habits and years of practice.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/0_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/0_setup.png" alt="Assigning Server Roles" /></a><br />
	Assigning Server Roles
</div>

<p>To start the installation and setup process, we will refer back to the Initial Configuration dashboard (click the pinned shortcut on the taskbar if you closed it already). Under section 3 there is a "Roles" category that will allow us to easily assign the necessary roles to our server.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/1_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/1_setup.png" alt="Assigning Server Roles" /></a><br />
	Assigning Server Roles
</div>

<h3>Installing the Active Directory Role</h3>

<p>The first page of the "Add Roles Wizard" presents us with some friendly reminders to set a static IP Address (check), ensure the Administrator account has a strong password (check), and make sure the server is up to date on Windows Updates (check). </p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/2_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/2_setup.png" alt="Assigning Server Roles" /></a><br />
	Assigning Server Roles
</div>

<p>Next we move on to the Roles selection page. As promised, we see a number of active directory services listed, the option for today being AD DS.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/3_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/3_setup.png" alt="Installing AD DS" /></a><br />
	Installing AD DS
</div>

<p>On selecting the AD DS option the wizard runs a quick validation and notices that our server does not appear to have a necessary component, in this case .Net Framework 3.5. </p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/4_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/4_setup.png" alt="Installing AD DS" /></a><br />
	Installing AD DS - Prerequisites
</div>

<p>After choosing to install the prerequisite (a difficult and time consuming decision, or perhaps not) and pressing next on the main screen, we are provided with a list of "Things to Note" as well as links to additional information, saving me the time of writing and linking them up myself.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/5_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/5_setup.png" alt="Installing AD DS" /></a><br />
	Installing AD DS - Things to Note
</div>

<p>A short confirmation displays the items we are installing, including the noted prerequisite above and a reminder that directory services won't truly be functional until we run "dcpromo".</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/6_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/6_setup.png" alt="Installing AD DS" /></a><br />
	Installing AD DS - Confirmation
</div>

<p>After the installation and verification is complete, we are presented a handy link to launch dcpromo.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/7_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/7_setup.png" alt="Installing AD DS" /></a><br />
	Installing AD DS - Wizard Complete
</div>

<div class="hint">
	If you accidentally close the window before pressing the link or need to access dcpromo later, the start menu's run input will recognize "dcpromo" and find the requisite shortcut for you.
</div>

<h3>AD DS Installation Wizard (DCPromo)</h3>
<p>The dcpromo wizard will complete the installation of AD DS on the server. </p>

<p>On the first step we are presented with the option to "Use Advanced Mode Setup". This option will cause several additional wizard windows to appear throughout the process that would have defaulted behind the scenes if it were not checked. Press the "advanced mode installation" hyperlink to get a help document about the additional options presented in advanced mode.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/7_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/7_setup.png" alt="DCPromo" /></a><br />
	DCPromo - Beginning
</div>

<p>After an informational screen about the suggested cryptography option and systems that may not support it, we are presented with the option to add a domain to an existing forest or to create a new domain under a new forest. This being our first DC in the virtual lab, we will be creating a new forest for our domain.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/8_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/8_setup.png" alt="DCPromo" /></a><br />
	DCPromo - New Forest and Domain
</div>

<p>Next type the fully qualified domain name (FQDN) for your domain. After typing this name the wizard will then scan to ensure the name is not already in use.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/9_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/9_setup.png" alt="DCPromo" /></a><br />
	DCPromo - FQDN Entry
</div>

<p>The wizard then prompts us to enter a Domain NetBIOS name, with a suggestion based on the name from the prior step.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/10_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/10_setup.png" alt="DCPromo" /></a><br />
	DCPromo - NetBIOS Name
</div>

<p>Next we'll set the functional level of our forest. The functional level defines the maximum level (and feature set) that our forest will support. When installing additional DCs in an existing forest or creating a business domain that you intend to support over the next ten years, this needs to be a well thought out decision. When installing in a virtual lab we will of course pick the highest possible level in less time than it took to write this paragraph.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/11_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/11_setup.png" alt="DCPromo" /></a><br />
	DCPromo - Functional Level
</div>

<div class="hint">
	One of the best reasons for using 2008 R2 mode is the new "Recycle Bin" option. This option keeps deleted entries in memory and provides an option to restore them, providing a bit of a safety net and reducing the potential for having to use the AD Recovery Mode to recover a deleted set of accounts or objects.
</div>
<div class="mylab">
Actually the Recycle Bin option worries me. I like admins (and myself) to be a little scared of their tools and nothing says scared like remembering that time you accidentally deleted something and spent recovering it manually. Oh well.
</div>

<p>After another quick scan of the network will tell us if DNS is available and supports the necessary capabilities for the domain controller. In this case, since we are installing a primary DC, I'm going to suggest we install DNS on the same server.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/12_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/12_setup.png" alt="DCPromo" /></a><br />
	DCPromo - DNS
</div>

<p>After selecting to install the DNS server we receive a warning that a delegation for the DNS server cannot be created because the authoritative parent zone for the domain name I entered earlier could not be found. Translated, this means that the server went looking for an authoritative DNS entry for the <i>avl.local</i> domain name I entered and determined that no one had ever heard of it. Since we are just now installing the DNS server that will recognize that name, this is to be expected and can be safely ignored. </p>

<p>The next step is to provide a location for the database and files that will be used by AD DS. In a non-lab setup this needs to be carefully planned to ensure enough capacity is available ahead of time. This being a virtual lab, we will be accepting the defaults and allowing it to carve out space from the primary drive.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/13_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/13_setup.png" alt="DCPromo" /></a><br />
	DCPromo - Database and File Locations
</div>

<p>The Directory Services Restore password is used only when major restoration activities need to be undertaken. After entering the password we will add it to our password safe so it won't be forgotten. This password will hopefully never be needed (especially in a lab environment), but not writing it down will pretty much ensure our first, future restoration step will be getting past the lack of a password.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/14_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/14_setup.png" alt="DCPromo" /></a><br />
	DCPromo - Restore Password
</div>

<p>After a brief summary of the selected configurations and the option to export these settings for an unattended installation, we are ready to let the server start installing.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/15_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/15_setup.png" alt="DCPromo" /></a><br />
	DCPromo - Installing
</div>
<p>The installer wraps up with the common Finish screen and a request to reboot.</p>

<p>After rebooting, our "Initial Configuration Tasks" window confirms our new roles have been installed. </p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/BasicDC/16_setup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/BasicDC/16_setup.png" alt="DCPromo" /></a><br />
	Initial Configuration Tasks - Roles
</div>

<h2>Managing the Domain</h2>
<p>Our next post will cover basic administration topics for the domain, as we add our first SQL Server system to the domain, create a new administrative user, and create a service account for our SQL Server services.</p>

<p><label>Additional Articles:</label><a href="http://wiki.lessthandot.com/index.php/Virtual_Lab" title="View the wiki entry">Virtual Lab entry on the LTD Wiki</a><br /></p>

<p><style>
.mylab, .hint{
   margin: .5em 2em;
   padding: 1em 1em 1em 90px;
}
.mylab{
   border: 2px solid #CCEECC;
   background-color: #DDFFDD;
   background-image: url(http://tiernok.com/LTDBlog/mylab.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.hint{
   border: 2px solid #EEEECC;
   background-color: #FFFFDD;
   background-image: url(http://tiernok.com/LTDBlog/tip.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.screenshot{
   text-align: center;
   font-size: .8em;
   margin-bottom: 1em;
}
.acc_header{ position: relative; }
.acc_header label{ float: left; width: 150px; font-weight: bold;}
.acc_header br{  clear: left; }
.acc_header .diff{ margin-top: 3px; }
</style></p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-creating-a-2008-r2-domain-co"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-creating-a-2008-r2-domain-co&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-creating-a-2008-r2-domain-co">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/SysAdmins/OS/Windows/2008Server/virtual-lab-creating-a-2008-r2-domain-co#comments</comments>
		</item>
				<item>
			<title>Virtual Lab: Creating the Basic SQL 2008 R2 Virtual Machine</title>
			<link>http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2</link>
			<pubDate>Thu, 20 May 2010 19:36:19 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="alt">Database Administration</category>
<category domain="main">Microsoft SQL Server Admin</category>			<guid isPermaLink="false">840@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;div class=&quot;acc_header&quot;&gt;
A virtual database server provides you the ability to not only work on database-relate tools and services, but also to try out hundreds of vendor products throughout the market that require a database backend. This article will walk through a basic database setup for SQL Server 2008 R2 on a virtual machine using mostly standard installation options. This first installation will be limited to basic settings and a virtual harddrive, leaving us ready to customize the setup for later uses.&lt;br /&gt;
&lt;br /&gt;
&lt;label&gt;Technical Area:&lt;/label&gt; Accidental Systems Administrator, Accidental Database Administrator&lt;br /&gt;&lt;br /&gt;
&lt;label class=&quot;diff&quot;&gt;Level of Difficulty: &lt;/label&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/dr_basic.png&quot; alt=&quot;Basic Difficulty&quot; /&gt;&lt;br /&gt;
&lt;label&gt;Additional Articles:&lt;/label&gt;&lt;a href=&quot;http://wiki.lessthandot.com/index.php/Virtual_Lab&quot; title=&quot;View the wiki entry&quot;&gt;Virtual Lab entry on the LTD Wiki&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;

&lt;h2&gt;Setting up the Virtual Machine&lt;/h2&gt;
&lt;p&gt;In the &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?p=830&quot; title=&quot;Read the first post&quot;&gt;first post&lt;/a&gt; we created a basic Windows 2008 R2 virtual machine to serve as a starting point for our later systems. Our first step will be to to make a copy of tis system for our new SQL Server installation. To begin with, we'll make a copy of the folder, renaming that copy to match the name we will be assigning to our new server. If we look inside the folder we will see a variety of configuration files, including the file that serves as our virtual harddrive.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/0_files.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/0_files.png&quot; alt=&quot;Files for VM&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	VM Folder and Files
&lt;/div&gt;

&lt;p&gt;TO keep things consistent, we will rename the vmx and vmxf files to match the new server name as well. Once we have edited the names we need to open the vmx file in using our favorite editor (mine is EditPlus) and edit the values for &quot;displayName&quot; and &quot;extendedConfigFile&quot; to reflect the new file names. It's possible to rename the other files but requires editing a larger number of configurations and I prefer to leave them with their original name to reflect the system I used as a template.&lt;/p&gt;

&lt;p&gt;To add the new, copied system to VMWare we open the menu and select the option to &quot;Add Virtual Machine to Inventory&quot;. &lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/0_AddVirtualMachine.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/0_AddVirtualMachine.png&quot; alt=&quot;Add Virtual Machine, Step 0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Adding a Virtual Machine, Step 0
&lt;/div&gt;

&lt;p&gt;A dialog is presented with the list of stores that are set up on the local system. We select the store our copied VM resides in and then select the VM. The center column should now show us the vmx file we renamed, so we will select that and press Ok.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/1_AddVirtualMachine.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/1_AddVirtualMachine.png&quot; alt=&quot;Add Virtual Machine, Step 1&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Adding a Virtual Machine, Step 1
&lt;/div&gt;
&lt;div class=&quot;hint&quot;&gt;
The &quot;standard&quot; store corresponds to the initial folder that VMWare generates when you first install it. By default this is &quot;C:\Virtual Machines&quot; for Windows. 
&lt;/div&gt;

&lt;p&gt;The next step, once the VM is added, is to modify some of the settings. This basic VM was created with 4GB of memory, bridged networking, and an optical disk pointing to the Windows 2008 R2 ISO. These settings were to optimize the installation process, but now we should modify them to fit the needs of our new system. The optical disk will be pointed to the ISO for the SQL Server installation disk and the memory will be reduced to a more reasonable value. The network will remain in bridged mode until virtual network management is addressed in a later post.&lt;/p&gt;

&lt;div class=&quot;mylab&quot;&gt;
Because I intend to have a number of servers running for some future articles, I have decided to start this system with 2GB of RAM. As the environment grows I may increase or decrease this number, depending on the number of systems I need to have running simultaneously.
&lt;/div&gt;

&lt;p&gt;The last step is to add a virtual drive for database storage. In later articles we will walk through comparisons of different virtual and physical drive options, but for today we will be creating a simple secondary virtual drive to serve as storage. This secondary drive will start off small, as we don't intend to work with a large amount of data on the system. &lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/4_AddVirtualMachine.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/4_AddVirtualMachine.png&quot; alt=&quot;Add Virtual Machine, Step 2 &amp;amp; 3&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Adding a Virtual Machine, Step 2 &amp;amp; 3
&lt;/div&gt;

&lt;h2&gt;Configuring the OS&lt;/h2&gt;
&lt;p&gt;Once the Virtual Machine is prepped, it's time to boot into our system for the first time and prepare it for the SQL Server installation.&lt;/p&gt;

&lt;p&gt;When we first attempt to start the new virtual machine, the below error message is displayed prominently on the VMWare interface and we have to select either the &quot;Copied&quot; or &quot;Moved&quot; option to continue.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/0_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/0_startup.png&quot; alt=&quot;VM Error Message&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	VM Startup Error Message
&lt;/div&gt;
&lt;div class=&quot;hint&quot;&gt;
VMWare has detected that the files have moved from their original location and is asking whether to treat this as a Move or a Copy. If you select the &quot;copied&quot; option, as I did, then some virtual hardware will be assigned new id's to ensure they aren't duplicates of the original system. This is particularly important for the MAC address of the network card. The downside is that enough id's are changed that Windows will require one of it's ten reactivations.
&lt;/div&gt;

&lt;p&gt;Before going too far with the new server, lets start by providing it with it's new name and executing the obligatory reboot.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/1_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/1_startup.png&quot; alt=&quot;Changing the System Name&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Changing the System Name
&lt;/div&gt;

&lt;div class=&quot;mylab&quot;&gt;
While going through this process I found more &quot;features&quot; between VMWare and Windows 7. I initially had difficulties with the network connections because the VMWare adapters kept getting assigned to the Unidentified Network. Following the registry editing instructions in this &lt;a href=&quot;http://aspoc.net/archives/2008/10/30/unidentified-network-issue-with-vmwares-virtual-nics-in-vista/&quot; title=&quot;Unidentified network in Vista&quot; target=&quot;_blank&quot;&gt;Windows Vista article&lt;/a&gt; appears to have corrected that.
&lt;/div&gt;

&lt;p&gt;Next up is mounting the new virtual drive. We can access the &quot;Server Management&quot; snap-in by right-clicking on the Computer in Explorer and selecting &quot;Manage&quot; or by typing &quot;Manage&quot; into the Start menu search and selecting &quot;Server Manager&quot;. In the left column is a treeview with a number of options. Expand the Storage option and select &quot;Disk Management&quot; to see the available disks. &lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/2_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/2_startup.png&quot; alt=&quot;Adding the new virtual disk&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Server Management - Adding a Disk
&lt;/div&gt;

&lt;p&gt;Initially the disk is listed as Offline (bottom of center column). Right-clicking the offline disk will provide the option to bring it Online. Once Online the disk will require initialization, so we right-click and select Initialize.&lt;/p&gt;

&lt;div class=&quot;mylab&quot;&gt;
When initializing the drive the system will ask whether you want to use a master boot record or GPT. Not knowing what GPT means (yet), I decided to use a master boot record. This is not a recommendation, simply an expression of my own ignorance and the addition of a new item to my list of things to be learned (GPT).
&lt;/div&gt;

&lt;p&gt;Once the drive reports a status of &quot;Initialized&quot; we can allocate it by right clicking on the volume and selecting &quot;New Simple Volume&quot;.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/3_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/3_startup.png&quot; alt=&quot;Adding the new virtual disk&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Server Management - Adding a Disk
&lt;/div&gt;

&lt;p&gt;Windows provides a wizard to walk through the drive allocation process. For the sake of this article we will select all of the defaults it provides, which should net a brand new 10237MB &quot;E:&quot; drive formatted for NTFS. Once the wizard is complete, the Server Management console will update the drive status and a dialog will appear with Windows asking if it can now format the new drive.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/4_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/4_startup.png&quot; alt=&quot;Adding the new virtual disk&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Server Management - Adding a Disk
&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
(This is more along the lines of experienced advice)&lt;br /&gt;&lt;br /&gt;
If something is complex enough to have a wizard and configuration system, it's generally complex enough for the defaults to give you an evenly rounded, mediocre set of settings. This is why system/storage/database admins cringe when they find systems installed with the defaults, the equivalent of carefully configuring the system to perform equally poorly for all possible situations.
&lt;/div&gt;

&lt;p&gt;When the Format screen appears, Windows provides several values and offers some defaults. Since this drive is going to be used primarily for SQL Server, we will change the &quot;Allocation Unit Size&quot; from 4K to 64K. &lt;/p&gt;

&lt;div class=&quot;hint&quot;&gt;
&lt;p&gt;SQL Server works in request sizes of 8k and 64K. Selecting allocation unit sizes for a drive (or stripe sizes for an array) is going to be based on two factors:&lt;br /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The options you get&lt;/li&gt;
&lt;li&gt;Your I/O pattern&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;You can find an excellent article here: &lt;a href=&quot;http://www.sqlservercentral.com/blogs/sqlmanofmystery/archive/2010/01/04/fundamentals-of-storage-systems-stripe-size-block-size-and-io-patterns.aspx&quot; target=&quot;_blank&quot;&gt;Fundamentals of Storage Systems: Stripe Size, Block Size, and I/O Patterns at SQL Server Central&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
The downside of a 64k unit size with NTFS is that NTFS compression requires 4k unit sizes, so selection of any other size means you cannot use this option.&lt;/p&gt;
&lt;/div&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/5_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/5_startup.png&quot; alt=&quot;Adding the new virtual disk&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Server Management - Adding a Disk
&lt;/div&gt;

&lt;p&gt;And finally the last step in our OS setup is to create a new administrative account for the future SQL Server services. While the Server Management console is still open, expand the Configuration option in the right column, expand &quot;Local Users and Groups&quot;, and select the &quot;Users&quot; option.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/6_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/6_startup.png&quot; alt=&quot;Adding an Administrative User&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Server Management - Adding a New User
&lt;/div&gt;

&lt;p&gt;To enter the new user information we'll right click in the center column. To reduce future surprises we'll make sure the checkboxes are set to not require password change.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/7_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/7_startup.png&quot; alt=&quot;Adding an Administrative User&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Server Management - Adding a New User
&lt;/div&gt;

&lt;p&gt;Elevating the user's permissions is fairly straightforward. After creating the user, we right click them and select &quot;Properties&quot;. We select the &quot;Member Of&quot; tab and add the user to the local Administrators group.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/8_startup.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/8_startup.png&quot; alt=&quot;Adding an Administrative User&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Server Management - Adding a New User
&lt;/div&gt;

&lt;h2&gt;Setting up SQL Server&lt;/h2&gt;
&lt;p&gt;If we had decided to use the host's optical drive for the VM's optical drive it would now be time to put the disc in the drive, whereas the ISO method should be good to go. &lt;/p&gt;

&lt;div class=&quot;hint&quot;&gt;If you need help determining what version of SQL to install, there is useful information on the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms144275.aspx&quot; title=&quot;View edition information for SQL Server 2008&quot; target=&quot;_blank&quot;&gt;edition information page at MSDN&lt;/a&gt;.&lt;/div&gt;

&lt;p&gt;As we begin the installation process, the installer is going to check our prerequisites right away (unlike some prior versions that seemed to require everything from dog trainers to fiery hoops to get the job done). Press &quot;Ok&quot; and let the setup installer do it's thing.&lt;/p&gt;

&lt;p&gt;Once this check passes (or we potentially go through the process of installing the .Net Framework and a newer version of Windows Installer), the setup process will present us with a &quot;SQL Server Installation Center&quot; window. If you haven't installed SQL Server recently, you are probably going to be surprised by the number of links that are available. Compared to the 5 menu options available on the SQL Server 2000 dialog, this one is almost a book.&lt;/p&gt;

&lt;h3&gt;Installation&lt;/h3&gt;
&lt;p&gt;First things first, lets make sure we have everything that SQL Server wants. The 5th option on the first screen is for the &quot;System Configuration Checker&quot;. Selecting this option will start a dialog/wizard process that is going to go through and verify we have any additional prerequisites (such as being logged in with administrative rights) that the installer will need.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/0_install.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/0_install.png&quot; alt=&quot;System Configuration Checker&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	System Configuration Checker - All Green
&lt;/div&gt;

&lt;p&gt;Once everything in the configuration checker is green, we can move on to the Installation. Selecting &quot;Installation&quot; from the right sidebar presents us with a new set of options to select from. As we are installing a new server from scratch, lets select the first option &quot;New Installation or Add features&quot;. After another Configuration Check, the setup presents a wizard for installing the Support Files.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/1_install.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/1_install.png&quot; alt=&quot;SQL Server 2008 R2 Setup - Support Files (Next, Next, Install)&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server 2008 R2 Setup - Support Files (Next, Next, Install)
&lt;/div&gt;

&lt;div class=&quot;mylab&quot;&gt;
	I did receive a warning at the end of the Support Files installation. Basically the wizard is just warning me that the firewall may block the TCP ports for SQL Server unless I configure it otherwise. As the firewall is still running the default settings from installation, it's probable you received this warning as well.&lt;br /&gt;
	&lt;div class=&quot;screenshot&quot;&gt;
&lt;p&gt;		&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/2_install.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/2_install.png&quot; alt=&quot;SQL Server 2008 R2 Setup - Firewall Warning&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
		SQL Server 2008 R2 Setup - Firewall Warning&lt;br /&gt;
	&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Once the Support Files have installed, we are presented with a dialog asking us to select whether we are trying to install SQL Server or PowerPivot for Sharepoint. Leaving SQL Server selected and pressing next will present us with a series of checkboxes to allow us to pick exactly which components we would like to install. Select the boxes the conform with what you intend to use the system for and press &quot;Next&quot;.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/3_install.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/3_install.png&quot; alt=&quot;SQL Server 2008 R2 Setup - Component Selection&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server 2008 R2 Setup - Component Selection
&lt;/div&gt;

&lt;div class=&quot;mylab&quot;&gt;
Since my intent is to create a basic database server, I have selected the bare minimum number of components that I will need. These are the Database Engine, client tools connectivity, and the Management Tools. I probably could have selected the basic set of tools for this system, but it won't make that big a difference.
&lt;/div&gt;

&lt;h3&gt;Installation Configuration&lt;/h3&gt;
&lt;p&gt;After making selections for what components to install, the setup program provides a number of screens to allow initial configuration of the system.&lt;/p&gt;

&lt;p&gt;First we should decide whether this will be the default instance on the server or a named instance. If we were working with an existing server than we would need to look at the existing installation to determine which way to answer this question. As we are installing our first instance no a virtual server, however, we can go ahead and select the Default option.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/4_install.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/4_install.png&quot; alt=&quot;SQL Server 2008 R2 Setup - Instance Configuration&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server 2008 R2 Setup - Instance Configuration
&lt;/div&gt;

&lt;p&gt;The disk space requirements step is always either purely informational or the beginning of a bad day. In this case we created our initial system with enough space to continue.&lt;/p&gt;

&lt;p&gt;Next we are setting up the accounts used for the system services. Press the &quot;Use the Same Account for all SQL Services&quot; button, select &quot;browse&quot; and find the NT User we created earlier. Enter the password for the user and press &quot;Ok&quot; to assign it.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/5_install.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/5_install.png&quot; alt=&quot;SQL Server 2008 R2 Setup - User Account Configuration&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server 2008 R2 Setup - User Account Configuration
&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
I don't suggest changing the collation from the default for your first SQL instance and I can't offer much assistance if you do. if you do choose to change the collation, however, I have a great deal of experience dealing with the results of servers being set to strange collations and not getting along, plus the site has a number of experts that know way more than I do about SQL Server administration. So if you do get adventurous and hurt yourself, put a post up in the &lt;a href=&quot;http://forum.lessthandot.com&quot; target=&quot;_blank&quot;&gt;forum&lt;/a&gt; and someone should be able to help you out. 
&lt;/div&gt;

&lt;p&gt;Next we have the Account Provisioning tab, Data Directory configuration, and FILESTREAM configuration. For Account Provisioning we have to decide whether every connection will be made using Windows Authentication or whether there is the potential that one or more of our vendors use SQL Authentication.&lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/6_install.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/6_install.png&quot; alt=&quot;SQL Server 2008 R2 Setup - Account Provisioning&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server 2008 R2 Setup - Account Provisioning
&lt;/div&gt;

&lt;div class=&quot;mylab&quot;&gt;
	Personally I always use mixed mode, though this may be the developer in me. In many environments we used SQL Authentication for in house web applications that had no special needs on the domain and thus did not get domain accounts (services and windows applications still used domain accounts). Some environments take the opposite approach and always crate separate domain accounts for every single web or local application. Many vendors go the SQL Authentication route because they can provide a script to create the user with necessary rights (or assume you will give them the sa password).
&lt;/div&gt;

&lt;p&gt;On the Data Directories tab we have the option of defining the default folders that files will be created in. Setting these defaults will not ensure other IT personnel will create files in the correct directories, but it will start them in the right place and catch those one-off backups people tend to leave in the SQL installation folders. &lt;/p&gt;

&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/7_install.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/7_install.png&quot; alt=&quot;SQL Server 2008 R2 Setup - Data Directories&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server 2008 R2 Setup - Data Directories
&lt;/div&gt;

&lt;p&gt;Continuing on through the next few screens, we should finally arrive at the &quot;Ready to Install&quot; screen. Pressing the &quot;Install&quot; button grants us one free coffee break, after which we will continue on with the initial configuration.&lt;/p&gt;

&lt;p&gt;(insert intermission music here)&lt;/p&gt;

&lt;h2&gt;SQL Server Configuration&lt;/h2&gt;
&lt;p&gt;After installation of the software, there are still a few steps before we are done. Before continuing, let's do a reboot and then ensure all of our services started correctly.&lt;/p&gt;

&lt;p&gt;The SQL Server Configuration Manager is available from the Start Menu (Start -&amp;gt; All Programs &amp;gt; SQL Server 2008 R2 &amp;gt; Configuration Tools &amp;gt; SQL Server Configuration Manager).&lt;/p&gt;

&lt;p&gt;Verify that the SQL Server service is set to start automatically and verify that the SQL Agent process is set the way we want it. If the Agent service is not correct, right click it and use the Properties dialog to set the startup to the appropriate value. &lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/0_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/0_config.png&quot; alt=&quot;SQL Server 2008 R2 Setup - SQL Server Configuration&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server 2008 R2 Setup - SQL Server Configuration
&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
	The SQL Server Browser service is what responds to tools like SSMS when they are browsing for available services on the intranet. Depending on your environment you can choose to leave this disabled (more secure) or you can use the properties dialog to set the service to startup automatically on boot.
&lt;/div&gt;

&lt;p&gt;Next we verify that the network configuration is set correctly. Since we intend to connect to the server from a remote client, we need to ensure that the TCP/IP option is enabled by right-clicking and entering the properties dialog.&lt;/p&gt;
&lt;div class=&quot;screenshot&quot;&gt;
	&lt;a href=&quot;http://tiernok.com/LTDBlog/FirstSQL/orig/1_config.png&quot; title=&quot;View Fullsize&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/FirstSQL/1_config.png&quot; alt=&quot;SQL Server 2008 R2 Setup - SQL Server Configuration&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	SQL Server 2008 R2 Setup - SQL Server Configuration
&lt;/div&gt;

&lt;div class=&quot;mylab&quot;&gt;
Oddly enough my TCP/IP setting was already enabled. Is it me or do they keep flipping the defaults back and forth for this setting in each major version?
&lt;/div&gt;

&lt;p&gt;If we have made any configuration changes in the past section we will want to do one last reboot. The SQL 2008 R2 installer did not ask for a reboot, but before we start working with the server we want to make sure  that the next reboot (when a real server would be in service) will not come with any surprises.&lt;/p&gt;

&lt;ol style=&quot;margin-left: 3em&quot;&gt;
   &lt;li&gt;Pin the &quot;SQL Server Configuration Manager&quot; to the Taskbar&lt;/li&gt;
   &lt;li&gt;Open SQL Server Management Studio (SSMS) and let it go through it's first time initialization&lt;/li&gt;
   &lt;li&gt;Verify that you can connect to the local server with the sa account in SSMS&lt;/li&gt;
   &lt;li&gt;Pin SSMS to the taskbar&lt;/li&gt;
   &lt;li&gt;Open SSMS on your Host system and verify you can connect to the server (depending on your VM network settings of course)&lt;/li&gt;
   &lt;li&gt;Record the new NT user and sa passwords in your password safe (I like &lt;a href=&quot;http://keepass.info/&quot; title=&quot;Visit the Keepass site&quot; target=&quot;_blank&quot;&gt;Keepass&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h2&gt;Additional Tasks&lt;/h2&gt;
&lt;p&gt;We still have a few more tasks to complete before we can call this system ready, though I won't be walking you through the rest of the way until a later post.&lt;/p&gt;

&lt;p&gt;Once we have the server set up this far, it's a good idea to go ahead and start setting up some of the internals, such as Database Mail and some of the Alerts. While these may be less useful on a test instance, it is good to build a habit of setting them up as part of a new instance. We also want to take this opportunity to reduce the amount of RAM assigned to SQL Server and set up our first backup schedule for our system databases.&lt;/p&gt;

&lt;p&gt;While this seemed like a fairly straight-forward Next, Next, Next, Done installation, there was some thought put into where I was going to put files, memory sizing, etc. I highly encourage you to check out &lt;a href=&quot;http://www.straightpathsql.com/archives/tag/installation/&quot; target=&quot;_blank&quot;&gt;this article series&lt;/a&gt; for a more extensive set of pre-installation questions and thoughts.&lt;/p&gt;

&lt;p&gt;In later weeks we will be working on the creation of a Domain Controller and Domain accounts, but afterward we will be coming back to this system and exploring other setup options, maintenance, and administrative activities.&lt;/p&gt;

&lt;p&gt;&lt;label&gt;Additional Articles:&lt;/label&gt;&lt;a href=&quot;http://wiki.lessthandot.com/index.php/Virtual_Lab&quot; title=&quot;View the wiki entry&quot;&gt;Virtual Lab entry on the LTD Wiki&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
.mylab, .hint{
   margin: .5em 2em;
   padding: 1em 1em 1em 90px;
}
.mylab{
   border: 2px solid #CCEECC;
   background-color: #DDFFDD;
   background-image: url(http://tiernok.com/LTDBlog/mylab.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.hint{
   border: 2px solid #EEEECC;
   background-color: #FFFFDD;
   background-image: url(http://tiernok.com/LTDBlog/tip.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.screenshot{
   text-align: center;
   font-size: .8em;
   margin-bottom: 1em;
}
.acc_header{ position: relative; }
.acc_header label{ float: left; width: 150px; font-weight: bold;}
.acc_header br{  clear: left; }
.acc_header .diff{ margin-top: 3px; }
&lt;/style&gt;&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<div class="acc_header">
A virtual database server provides you the ability to not only work on database-relate tools and services, but also to try out hundreds of vendor products throughout the market that require a database backend. This article will walk through a basic database setup for SQL Server 2008 R2 on a virtual machine using mostly standard installation options. This first installation will be limited to basic settings and a virtual harddrive, leaving us ready to customize the setup for later uses.<br />
<br />
<label>Technical Area:</label> Accidental Systems Administrator, Accidental Database Administrator<br /><br />
<label class="diff">Level of Difficulty: </label><img src="http://tiernok.com/LTDBlog/dr_basic.png" alt="Basic Difficulty" /><br />
<label>Additional Articles:</label><a href="http://wiki.lessthandot.com/index.php/Virtual_Lab" title="View the wiki entry">Virtual Lab entry on the LTD Wiki</a><br /><br />
<br />
</div>

<h2>Setting up the Virtual Machine</h2>
<p>In the <a href="http://blogs.lessthandot.com/index.php/All/?p=830" title="Read the first post">first post</a> we created a basic Windows 2008 R2 virtual machine to serve as a starting point for our later systems. Our first step will be to to make a copy of tis system for our new SQL Server installation. To begin with, we'll make a copy of the folder, renaming that copy to match the name we will be assigning to our new server. If we look inside the folder we will see a variety of configuration files, including the file that serves as our virtual harddrive.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/0_files.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/0_files.png" alt="Files for VM" /></a><br />
	VM Folder and Files
</div>

<p>TO keep things consistent, we will rename the vmx and vmxf files to match the new server name as well. Once we have edited the names we need to open the vmx file in using our favorite editor (mine is EditPlus) and edit the values for "displayName" and "extendedConfigFile" to reflect the new file names. It's possible to rename the other files but requires editing a larger number of configurations and I prefer to leave them with their original name to reflect the system I used as a template.</p>

<p>To add the new, copied system to VMWare we open the menu and select the option to "Add Virtual Machine to Inventory". </p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/0_AddVirtualMachine.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/0_AddVirtualMachine.png" alt="Add Virtual Machine, Step 0" /></a><br />
	Adding a Virtual Machine, Step 0
</div>

<p>A dialog is presented with the list of stores that are set up on the local system. We select the store our copied VM resides in and then select the VM. The center column should now show us the vmx file we renamed, so we will select that and press Ok.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/1_AddVirtualMachine.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/1_AddVirtualMachine.png" alt="Add Virtual Machine, Step 1" /></a><br />
	Adding a Virtual Machine, Step 1
</div>
<div class="hint">
The "standard" store corresponds to the initial folder that VMWare generates when you first install it. By default this is "C:\Virtual Machines" for Windows. 
</div>

<p>The next step, once the VM is added, is to modify some of the settings. This basic VM was created with 4GB of memory, bridged networking, and an optical disk pointing to the Windows 2008 R2 ISO. These settings were to optimize the installation process, but now we should modify them to fit the needs of our new system. The optical disk will be pointed to the ISO for the SQL Server installation disk and the memory will be reduced to a more reasonable value. The network will remain in bridged mode until virtual network management is addressed in a later post.</p>

<div class="mylab">
Because I intend to have a number of servers running for some future articles, I have decided to start this system with 2GB of RAM. As the environment grows I may increase or decrease this number, depending on the number of systems I need to have running simultaneously.
</div>

<p>The last step is to add a virtual drive for database storage. In later articles we will walk through comparisons of different virtual and physical drive options, but for today we will be creating a simple secondary virtual drive to serve as storage. This secondary drive will start off small, as we don't intend to work with a large amount of data on the system. </p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/4_AddVirtualMachine.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/4_AddVirtualMachine.png" alt="Add Virtual Machine, Step 2 &amp; 3" /></a><br />
	Adding a Virtual Machine, Step 2 &amp; 3
</div>

<h2>Configuring the OS</h2>
<p>Once the Virtual Machine is prepped, it's time to boot into our system for the first time and prepare it for the SQL Server installation.</p>

<p>When we first attempt to start the new virtual machine, the below error message is displayed prominently on the VMWare interface and we have to select either the "Copied" or "Moved" option to continue.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/0_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/0_startup.png" alt="VM Error Message" /></a><br />
	VM Startup Error Message
</div>
<div class="hint">
VMWare has detected that the files have moved from their original location and is asking whether to treat this as a Move or a Copy. If you select the "copied" option, as I did, then some virtual hardware will be assigned new id's to ensure they aren't duplicates of the original system. This is particularly important for the MAC address of the network card. The downside is that enough id's are changed that Windows will require one of it's ten reactivations.
</div>

<p>Before going too far with the new server, lets start by providing it with it's new name and executing the obligatory reboot.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/1_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/1_startup.png" alt="Changing the System Name" /></a><br />
	Changing the System Name
</div>

<div class="mylab">
While going through this process I found more "features" between VMWare and Windows 7. I initially had difficulties with the network connections because the VMWare adapters kept getting assigned to the Unidentified Network. Following the registry editing instructions in this <a href="http://aspoc.net/archives/2008/10/30/unidentified-network-issue-with-vmwares-virtual-nics-in-vista/" title="Unidentified network in Vista" target="_blank">Windows Vista article</a> appears to have corrected that.
</div>

<p>Next up is mounting the new virtual drive. We can access the "Server Management" snap-in by right-clicking on the Computer in Explorer and selecting "Manage" or by typing "Manage" into the Start menu search and selecting "Server Manager". In the left column is a treeview with a number of options. Expand the Storage option and select "Disk Management" to see the available disks. </p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/2_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/2_startup.png" alt="Adding the new virtual disk" /></a><br />
	Server Management - Adding a Disk
</div>

<p>Initially the disk is listed as Offline (bottom of center column). Right-clicking the offline disk will provide the option to bring it Online. Once Online the disk will require initialization, so we right-click and select Initialize.</p>

<div class="mylab">
When initializing the drive the system will ask whether you want to use a master boot record or GPT. Not knowing what GPT means (yet), I decided to use a master boot record. This is not a recommendation, simply an expression of my own ignorance and the addition of a new item to my list of things to be learned (GPT).
</div>

<p>Once the drive reports a status of "Initialized" we can allocate it by right clicking on the volume and selecting "New Simple Volume".</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/3_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/3_startup.png" alt="Adding the new virtual disk" /></a><br />
	Server Management - Adding a Disk
</div>

<p>Windows provides a wizard to walk through the drive allocation process. For the sake of this article we will select all of the defaults it provides, which should net a brand new 10237MB "E:" drive formatted for NTFS. Once the wizard is complete, the Server Management console will update the drive status and a dialog will appear with Windows asking if it can now format the new drive.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/4_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/4_startup.png" alt="Adding the new virtual disk" /></a><br />
	Server Management - Adding a Disk
</div>

<div class="hint">
(This is more along the lines of experienced advice)<br /><br />
If something is complex enough to have a wizard and configuration system, it's generally complex enough for the defaults to give you an evenly rounded, mediocre set of settings. This is why system/storage/database admins cringe when they find systems installed with the defaults, the equivalent of carefully configuring the system to perform equally poorly for all possible situations.
</div>

<p>When the Format screen appears, Windows provides several values and offers some defaults. Since this drive is going to be used primarily for SQL Server, we will change the "Allocation Unit Size" from 4K to 64K. </p>

<div class="hint">
<p>SQL Server works in request sizes of 8k and 64K. Selecting allocation unit sizes for a drive (or stripe sizes for an array) is going to be based on two factors:<br /></p>
<ul>
<li>The options you get</li>
<li>Your I/O pattern</li></ul>
<p>You can find an excellent article here: <a href="http://www.sqlservercentral.com/blogs/sqlmanofmystery/archive/2010/01/04/fundamentals-of-storage-systems-stripe-size-block-size-and-io-patterns.aspx" target="_blank">Fundamentals of Storage Systems: Stripe Size, Block Size, and I/O Patterns at SQL Server Central</a><br /><br />
The downside of a 64k unit size with NTFS is that NTFS compression requires 4k unit sizes, so selection of any other size means you cannot use this option.</p>
</div>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/5_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/5_startup.png" alt="Adding the new virtual disk" /></a><br />
	Server Management - Adding a Disk
</div>

<p>And finally the last step in our OS setup is to create a new administrative account for the future SQL Server services. While the Server Management console is still open, expand the Configuration option in the right column, expand "Local Users and Groups", and select the "Users" option.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/6_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/6_startup.png" alt="Adding an Administrative User" /></a><br />
	Server Management - Adding a New User
</div>

<p>To enter the new user information we'll right click in the center column. To reduce future surprises we'll make sure the checkboxes are set to not require password change.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/7_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/7_startup.png" alt="Adding an Administrative User" /></a><br />
	Server Management - Adding a New User
</div>

<p>Elevating the user's permissions is fairly straightforward. After creating the user, we right click them and select "Properties". We select the "Member Of" tab and add the user to the local Administrators group.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/8_startup.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/8_startup.png" alt="Adding an Administrative User" /></a><br />
	Server Management - Adding a New User
</div>

<h2>Setting up SQL Server</h2>
<p>If we had decided to use the host's optical drive for the VM's optical drive it would now be time to put the disc in the drive, whereas the ISO method should be good to go. </p>

<div class="hint">If you need help determining what version of SQL to install, there is useful information on the <a href="http://msdn.microsoft.com/en-us/library/ms144275.aspx" title="View edition information for SQL Server 2008" target="_blank">edition information page at MSDN</a>.</div>

<p>As we begin the installation process, the installer is going to check our prerequisites right away (unlike some prior versions that seemed to require everything from dog trainers to fiery hoops to get the job done). Press "Ok" and let the setup installer do it's thing.</p>

<p>Once this check passes (or we potentially go through the process of installing the .Net Framework and a newer version of Windows Installer), the setup process will present us with a "SQL Server Installation Center" window. If you haven't installed SQL Server recently, you are probably going to be surprised by the number of links that are available. Compared to the 5 menu options available on the SQL Server 2000 dialog, this one is almost a book.</p>

<h3>Installation</h3>
<p>First things first, lets make sure we have everything that SQL Server wants. The 5th option on the first screen is for the "System Configuration Checker". Selecting this option will start a dialog/wizard process that is going to go through and verify we have any additional prerequisites (such as being logged in with administrative rights) that the installer will need.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/0_install.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/0_install.png" alt="System Configuration Checker" /></a><br />
	System Configuration Checker - All Green
</div>

<p>Once everything in the configuration checker is green, we can move on to the Installation. Selecting "Installation" from the right sidebar presents us with a new set of options to select from. As we are installing a new server from scratch, lets select the first option "New Installation or Add features". After another Configuration Check, the setup presents a wizard for installing the Support Files.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/1_install.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/1_install.png" alt="SQL Server 2008 R2 Setup - Support Files (Next, Next, Install)" /></a><br />
	SQL Server 2008 R2 Setup - Support Files (Next, Next, Install)
</div>

<div class="mylab">
	I did receive a warning at the end of the Support Files installation. Basically the wizard is just warning me that the firewall may block the TCP ports for SQL Server unless I configure it otherwise. As the firewall is still running the default settings from installation, it's probable you received this warning as well.<br />
	<div class="screenshot">
<p>		<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/2_install.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/2_install.png" alt="SQL Server 2008 R2 Setup - Firewall Warning" /></a><br />
		SQL Server 2008 R2 Setup - Firewall Warning<br />
	</p></div>
</div><p></p>

<p>Once the Support Files have installed, we are presented with a dialog asking us to select whether we are trying to install SQL Server or PowerPivot for Sharepoint. Leaving SQL Server selected and pressing next will present us with a series of checkboxes to allow us to pick exactly which components we would like to install. Select the boxes the conform with what you intend to use the system for and press "Next".</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/3_install.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/3_install.png" alt="SQL Server 2008 R2 Setup - Component Selection" /></a><br />
	SQL Server 2008 R2 Setup - Component Selection
</div>

<div class="mylab">
Since my intent is to create a basic database server, I have selected the bare minimum number of components that I will need. These are the Database Engine, client tools connectivity, and the Management Tools. I probably could have selected the basic set of tools for this system, but it won't make that big a difference.
</div>

<h3>Installation Configuration</h3>
<p>After making selections for what components to install, the setup program provides a number of screens to allow initial configuration of the system.</p>

<p>First we should decide whether this will be the default instance on the server or a named instance. If we were working with an existing server than we would need to look at the existing installation to determine which way to answer this question. As we are installing our first instance no a virtual server, however, we can go ahead and select the Default option.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/4_install.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/4_install.png" alt="SQL Server 2008 R2 Setup - Instance Configuration" /></a><br />
	SQL Server 2008 R2 Setup - Instance Configuration
</div>

<p>The disk space requirements step is always either purely informational or the beginning of a bad day. In this case we created our initial system with enough space to continue.</p>

<p>Next we are setting up the accounts used for the system services. Press the "Use the Same Account for all SQL Services" button, select "browse" and find the NT User we created earlier. Enter the password for the user and press "Ok" to assign it.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/5_install.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/5_install.png" alt="SQL Server 2008 R2 Setup - User Account Configuration" /></a><br />
	SQL Server 2008 R2 Setup - User Account Configuration
</div>

<div class="hint">
I don't suggest changing the collation from the default for your first SQL instance and I can't offer much assistance if you do. if you do choose to change the collation, however, I have a great deal of experience dealing with the results of servers being set to strange collations and not getting along, plus the site has a number of experts that know way more than I do about SQL Server administration. So if you do get adventurous and hurt yourself, put a post up in the <a href="http://forum.lessthandot.com" target="_blank">forum</a> and someone should be able to help you out. 
</div>

<p>Next we have the Account Provisioning tab, Data Directory configuration, and FILESTREAM configuration. For Account Provisioning we have to decide whether every connection will be made using Windows Authentication or whether there is the potential that one or more of our vendors use SQL Authentication.</p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/6_install.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/6_install.png" alt="SQL Server 2008 R2 Setup - Account Provisioning" /></a><br />
	SQL Server 2008 R2 Setup - Account Provisioning
</div>

<div class="mylab">
	Personally I always use mixed mode, though this may be the developer in me. In many environments we used SQL Authentication for in house web applications that had no special needs on the domain and thus did not get domain accounts (services and windows applications still used domain accounts). Some environments take the opposite approach and always crate separate domain accounts for every single web or local application. Many vendors go the SQL Authentication route because they can provide a script to create the user with necessary rights (or assume you will give them the sa password).
</div>

<p>On the Data Directories tab we have the option of defining the default folders that files will be created in. Setting these defaults will not ensure other IT personnel will create files in the correct directories, but it will start them in the right place and catch those one-off backups people tend to leave in the SQL installation folders. </p>

<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/7_install.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/7_install.png" alt="SQL Server 2008 R2 Setup - Data Directories" /></a><br />
	SQL Server 2008 R2 Setup - Data Directories
</div>

<p>Continuing on through the next few screens, we should finally arrive at the "Ready to Install" screen. Pressing the "Install" button grants us one free coffee break, after which we will continue on with the initial configuration.</p>

<p>(insert intermission music here)</p>

<h2>SQL Server Configuration</h2>
<p>After installation of the software, there are still a few steps before we are done. Before continuing, let's do a reboot and then ensure all of our services started correctly.</p>

<p>The SQL Server Configuration Manager is available from the Start Menu (Start -&gt; All Programs &gt; SQL Server 2008 R2 &gt; Configuration Tools &gt; SQL Server Configuration Manager).</p>

<p>Verify that the SQL Server service is set to start automatically and verify that the SQL Agent process is set the way we want it. If the Agent service is not correct, right click it and use the Properties dialog to set the startup to the appropriate value. </p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/0_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/0_config.png" alt="SQL Server 2008 R2 Setup - SQL Server Configuration" /></a><br />
	SQL Server 2008 R2 Setup - SQL Server Configuration
</div>

<div class="hint">
	The SQL Server Browser service is what responds to tools like SSMS when they are browsing for available services on the intranet. Depending on your environment you can choose to leave this disabled (more secure) or you can use the properties dialog to set the service to startup automatically on boot.
</div>

<p>Next we verify that the network configuration is set correctly. Since we intend to connect to the server from a remote client, we need to ensure that the TCP/IP option is enabled by right-clicking and entering the properties dialog.</p>
<div class="screenshot">
	<a href="http://tiernok.com/LTDBlog/FirstSQL/orig/1_config.png" title="View Fullsize" target="_blank"><img src="http://tiernok.com/LTDBlog/FirstSQL/1_config.png" alt="SQL Server 2008 R2 Setup - SQL Server Configuration" /></a><br />
	SQL Server 2008 R2 Setup - SQL Server Configuration
</div>

<div class="mylab">
Oddly enough my TCP/IP setting was already enabled. Is it me or do they keep flipping the defaults back and forth for this setting in each major version?
</div>

<p>If we have made any configuration changes in the past section we will want to do one last reboot. The SQL 2008 R2 installer did not ask for a reboot, but before we start working with the server we want to make sure  that the next reboot (when a real server would be in service) will not come with any surprises.</p>

<ol style="margin-left: 3em">
   <li>Pin the "SQL Server Configuration Manager" to the Taskbar</li>
   <li>Open SQL Server Management Studio (SSMS) and let it go through it's first time initialization</li>
   <li>Verify that you can connect to the local server with the sa account in SSMS</li>
   <li>Pin SSMS to the taskbar</li>
   <li>Open SSMS on your Host system and verify you can connect to the server (depending on your VM network settings of course)</li>
   <li>Record the new NT user and sa passwords in your password safe (I like <a href="http://keepass.info/" title="Visit the Keepass site" target="_blank">Keepass</a>)</li>
</ol>
<p><br /></p>
<h2>Additional Tasks</h2>
<p>We still have a few more tasks to complete before we can call this system ready, though I won't be walking you through the rest of the way until a later post.</p>

<p>Once we have the server set up this far, it's a good idea to go ahead and start setting up some of the internals, such as Database Mail and some of the Alerts. While these may be less useful on a test instance, it is good to build a habit of setting them up as part of a new instance. We also want to take this opportunity to reduce the amount of RAM assigned to SQL Server and set up our first backup schedule for our system databases.</p>

<p>While this seemed like a fairly straight-forward Next, Next, Next, Done installation, there was some thought put into where I was going to put files, memory sizing, etc. I highly encourage you to check out <a href="http://www.straightpathsql.com/archives/tag/installation/" target="_blank">this article series</a> for a more extensive set of pre-installation questions and thoughts.</p>

<p>In later weeks we will be working on the creation of a Domain Controller and Domain accounts, but afterward we will be coming back to this system and exploring other setup options, maintenance, and administrative activities.</p>

<p><label>Additional Articles:</label><a href="http://wiki.lessthandot.com/index.php/Virtual_Lab" title="View the wiki entry">Virtual Lab entry on the LTD Wiki</a><br /><br /><br />
<style type="text/css">
.mylab, .hint{
   margin: .5em 2em;
   padding: 1em 1em 1em 90px;
}
.mylab{
   border: 2px solid #CCEECC;
   background-color: #DDFFDD;
   background-image: url(http://tiernok.com/LTDBlog/mylab.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.hint{
   border: 2px solid #EEEECC;
   background-color: #FFFFDD;
   background-image: url(http://tiernok.com/LTDBlog/tip.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.screenshot{
   text-align: center;
   font-size: .8em;
   margin-bottom: 1em;
}
.acc_header{ position: relative; }
.acc_header label{ float: left; width: 150px; font-weight: bold;}
.acc_header br{  clear: left; }
.acc_header .diff{ margin-top: 3px; }
</style></p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2#comments</comments>
		</item>
				<item>
			<title>Building the Virtual Lab: VMWare and MS Windows 2008 R2</title>
			<link>http://blogs.lessthandot.com/index.php/SysAdmins/OS/building-the-virtual-lab-vmware-and-2008</link>
			<pubDate>Tue, 11 May 2010 14:41:54 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="main">Operating Systems</category>
<category domain="alt">Windows</category>
<category domain="alt">2008 Server</category>			<guid isPermaLink="false">830@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Asking me what I do for living could net you different answers, depending on what day you ask. Over the years, and through the course of several jobs, I have had a wide range of responsibilities that often stretched well beyond my current organizational role. I like to call these opportunities.&lt;/p&gt;

&lt;p&gt;Recently I was considering the idea of building a virtual lab, as I've been worried that some of the varied experiences or skills I've picked up would rust away. While in Wisconsin visiting Ted Krueger (&lt;a href=&quot;http://twitter.com/onpnt&quot; title=&quot;Ted on Twitter&quot;&gt;twitter&lt;/a&gt; | &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=68&quot; title=&quot;Ted's blogs here&quot;&gt;blog&lt;/a&gt;) for &lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/EthicsIT/my-singing-not-so-good&quot; title=&quot;SQL Saturday Chicago article&quot;&gt;SQL Saturday Chicago&lt;/a&gt;, I realized that the lab could serve two purposes. I could use it to not only regain or sharpen aging skills, but I could also use it to start blogging on more technical matters. Don't get me wrong, I love process and personal improvement topics, but I need my tech fix too.&lt;/p&gt;

&lt;p&gt;So here we are. If you don't already have a virtual lab at work or home then I invite you to follow along with me as I build one. Each blog entry will have a general level of difficulty, from basic installation &lt;img src=&quot;http://tiernok.com/LTDBlog/dr_beanie.png&quot; alt=&quot;propeller beanie&quot; /&gt; to advanced administration &lt;img src=&quot;http://tiernok.com/LTDBlog/dr_wizard.png&quot; alt=&quot;wizard's hat&quot; /&gt;. As the lab grows we will be installing a wide number of systems then later configuring and tuning them to meet different circumstances and needs. &lt;/p&gt;

&lt;p&gt;Lets get started.&lt;/p&gt;

&lt;p&gt;&lt;style&gt;
.mylab, .hint{
   margin: .5em 2em;
   padding: 1em 1em 1em 90px;
}
.mylab{
   border: 2px solid #CCEECC;
   background-color: #DDFFDD;
   background-image: url(http://tiernok.com/LTDBlog/mylab.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.hint{
   border: 2px solid #EEEECC;
   background-color: #FFFFDD;
   background-image: url(http://tiernok.com/LTDBlog/tip.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.acc_header{ position: relative; }
.acc_header label{ float: left; width: 150px; font-weight: bold;}
.acc_header br{  clear: left; }
.acc_header .diff{ margin-top: 3px; }
&lt;/style&gt;&lt;/p&gt;

&lt;div class=&quot;acc_header&quot;&gt;
&lt;h2&gt;Virtual Lab: Building the First Windows 2008 R2 Virtual Machine&lt;/h2&gt;
&lt;p&gt;The purpose of today's article is to create a basic windows virtual machine that can serve as a template for later virtual machines. Having a basic image or set of images on hand can dramatically speed up production and non-production roll-outs as well as ensure standardization of systems across your environment.&lt;br /&gt;
&lt;br /&gt;
&lt;label&gt;Technical Area:&lt;/label&gt; Accidental Systems Administrator&lt;br /&gt;&lt;br /&gt;
&lt;label class=&quot;diff&quot;&gt;Level of Difficulty: &lt;/label&gt;&lt;img src=&quot;http://tiernok.com/LTDBlog/dr_basic.png&quot; alt=&quot;Basic Difficulty&quot; /&gt;&lt;br /&gt;
&lt;label&gt;Additional Articles:&lt;/label&gt;&lt;a href=&quot;http://wiki.lessthandot.com/index.php/Virtual_Lab&quot; title=&quot;View the wiki entry&quot;&gt;Virtual Lab entry on the LTD Wiki&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;h2&gt;Building the Lab Environment&lt;/h2&gt;
&lt;p&gt;Building your own lab can be both fun and a learning experience. A virtual lab provides you a safe place to try new technologies and configurations. When you create a really horrendous set of configurations in your lab, your halls are going to be remarkably free of end users with torches and pitchforks. The risks you should never take in production environments, even production development systems, are fair game here. But first we have to build it.&lt;/p&gt;

&lt;h3&gt;Environment&lt;/h3&gt;
&lt;p&gt;First we should determine what type of environment we want to run and what types of technologies or systems we would like to play with. Some of you will be planning no working with just development software and/or database servers, some will be want to create a virtual business environment (DC, Exchange, AD, etc), and some will even want to play with a mixed operating system setup. Identifying some general requirements will also help when your lab (or the market) grows past the current list of technologies you want to try.&lt;/p&gt;

&lt;p&gt;Here is a sample set of questions you should consider:&lt;/p&gt;
&lt;ol style=&quot;margin-left: 2em;&quot;&gt;
&lt;li&gt;What OS's are you intending to run? Desktop, Server, Windows, Unix, Linux ?&lt;/li&gt;
&lt;li&gt;What major software packages or technical areas are you intended to explore in the lab?&lt;/li&gt;
&lt;li&gt;Will any of the systems be used for active development (ie, results will be ported directly to production)?&lt;/li&gt;
&lt;li&gt;Will any of the systems potentially move to production?&lt;/li&gt;
&lt;li&gt;Will any of the systems need to travel with you (between sites, work and home, or to conferences)?&lt;/li&gt;
&lt;li&gt;Will your systems need to run only some of the time, all the time, or a mix?&lt;/li&gt;
&lt;li&gt;Will they require network access to the outside world?&lt;/li&gt;
&lt;li&gt;Will the outside world be allowed to access your lab resources?&lt;/li&gt;
&lt;li&gt;Will you need a private network in your lab or can they coexist on your existing network?&lt;/li&gt;
&lt;li&gt;Will there be interdependencies? (for instance, Server A is running DNS and Active Directory and has to be on for Server B to work properly)&lt;/li&gt;
&lt;/ol&gt;


&lt;div class=&quot;mylab&quot;&gt;
&lt;p&gt;And some of the answers for my lab:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;My lab will be running multiple Windows servers and 1-2 linux systems&lt;/li&gt;
&lt;li&gt;Software packages: SQL Server (of course), TFS, Active Directory, Sharepoint, potentially a DC, possibly Exchange, ...pretty much anything in Microsoft's catalog or that comes in as a user request is fair game&lt;/li&gt;
&lt;li&gt;None of these systems will go to a production environment or be accessed by active development environments&lt;/li&gt;
&lt;li&gt;The only environments that may need to travel are the SQL Server ones&lt;/li&gt;
&lt;li&gt;None of the systems will need to run all of the time&lt;/li&gt;
&lt;li&gt;The lab systems will be on a private network with limited external access&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;

&lt;h3&gt;Platform Selection&lt;/h3&gt;
&lt;p&gt;Once we have an idea what we our lab will be used for, we need to determine what type of platform to use. If this is a home lab or you have limited space for equipment, you will probably want to go with a virtualization platform. Using a virtualization platform allows us to have a smaller physical (and electrical) footprint and multi-purpose our equipment, since many of our test servers will not need to be running when we aren't directly using them. Virtualization also allows us to move systems to upgraded hosts if we later find ourselves having performance problems.&lt;/p&gt;

&lt;p&gt;The hardware you use will depend on the types of answers you provided to the questions above. Using an old desktop might be a acceptable solution or you may need to incorporate higher end systems or even spare servers. My last setup (2007-2009) used an off-the-shelf Dell Precision work station as the host without any extra equipment or over-the-top upgrades. The system performed well as a low budget SQL Server and Windows server platform. On the other hand my new environment will need to support a far wider range and number of systems, so it will require higher performance hardware.&lt;/p&gt;

&lt;div class=&quot;mylab&quot;&gt;
	Here is the current hardware setup for the lab:&lt;br /&gt;
	&lt;ul&gt;
	&lt;li&gt;CPU: A Intel i7 920 quad-core&lt;/li&gt;
	&lt;li&gt;Memory: 10 GB of DDR3 RAM w/ room to upgrade up to 24GB&lt;/li&gt;
	&lt;li&gt;Storage #1: Raid 10 Array - (4) SATA2 7200RPM 500GB drives, mixed manufacturers&lt;/li&gt;
	&lt;li&gt;Storage #2: &lt;a href=&quot;http://www.amazon.com/Vantec-NST-360SU-BK-3-5-Inch-External-Enclosure/dp/B000EDKO04/ref=sr_1_1?ie=UTF8&amp;amp;s=electronics&amp;amp;qid=1272804217&amp;amp;sr=8-1&quot; title=&quot;View at Amazon&quot;&gt;Vantec external enclosure&lt;/a&gt; w/ 500GB SATA2 drive (USB2/eSata) - raw storage for some backups, MSDN images, and other purchased software&lt;/li&gt;
	&lt;li&gt;Storage #3: &lt;a href=&quot;http://www.amazon.com/TWO-BAY-SATA-DOCKING-STATION/dp/B001UHQFVA/ref=sr_1_5?ie=UTF8&amp;amp;s=electronics&amp;amp;qid=1272804276&amp;amp;sr=1-5&quot; title=&quot;View at amazon&quot;&gt;Bytecc two-bay docking station&lt;/a&gt;  (USB2/eSata) - more disk (will be critical in a later article)&lt;/li&gt;
	&lt;/ul&gt;
&lt;p&gt;	I have selected VMWare for my virtualization platform. There are a number of reasons for this (for instance, Microsoft hard-blocking virtual server installations on Windows 7) and I actually would have preferred MS Virtual Server, but such is life.&lt;/p&gt;
&lt;/div&gt;

&lt;h2&gt;Installing our First Virtual Server&lt;/h2&gt;
&lt;p&gt;From this point forward we will be working from the comfort of my home lab, so examples will be based on VMWare Server 2.1 and I will point out versions for other software as it is introduced. The purpose of this first virtual machine is to serve as a template for later machines, allowing me to build out one image that with a standard base configuration, installs all common services, then apply all the outstanding Windows updates. Though I will be using the term 'template' in the article, this shouldn't be confused with the template capability in VMware's vSphere. &lt;/p&gt;
&lt;div class=&quot;hint&quot;&gt;
In a production environment it is extremely helpful to have a basic server image already pre-configured and up to date. Not only does it provide a faster alternative to building each server from scratch, but it ensures that each server goes out with all of the required services and configurations and does so without adding a checklist to your process. Not that I am a &lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3&quot; title=&quot;Or maybe I am&quot;&gt;process improvement fan&lt;/a&gt; or anything.
&lt;/div&gt;
&lt;p&gt;Though the software is different, many of the concepts will be similar if your lab is going to be based on Microsoft Virtual Server 2005 and I have successfully followed almost the same exact steps through Virtual Server in the past.&lt;/p&gt;

&lt;h3&gt;Build the Server&lt;/h3&gt;
&lt;p&gt;First we need to build our virtual machine. Opening the VMWare Server Host and logging in with administrative credentials, we are presented with a dashboard view of our system.&lt;br /&gt;
	&lt;/p&gt;&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/vmware_beginning.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/vmware_beginning.png&quot; title=&quot;VMWare, Freshly Installed&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
	VMWare, Freshly Installed&lt;br /&gt;
	&lt;/div&gt;

&lt;p&gt;Clicking the &quot;Virtual Machine&quot; menu provides an option to &quot;Create Virtual Machine&quot; and a wizard to walk us through the creation of our virtual machine.&lt;br /&gt;
	&lt;/p&gt;&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/vmware_create_vm.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/vmware_create_vm.png&quot; title=&quot;VMWare Menu, Create VM&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Create a new VM&lt;br /&gt;
	&lt;/div&gt;
&lt;p&gt;While it isn't critical to pick a good name at this point, it couldn't hurt either. Later as we create servers for specific purposes the VM names will reflect the actual names of their servers.&lt;br /&gt;
	&lt;/p&gt;&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/vm_step1.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/vm_step1.png&quot; title=&quot;Creating a new VM, Step 1&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	New VM - Provide a Name&lt;br /&gt;
	&lt;/div&gt;
&lt;p&gt;In my case I intend to use Windows 2008 R2 as my main server environment, so this basic image will reflect that in it's name and I will choose the Windows 2008 option from the operating systems tab. Before choosing the 64-bit image I made sure to run the &lt;a href=&quot;http://downloads.vmware.com/d/info/datacenter_downloads/vmware_server/2_0#drivers_tools&quot; title=&quot;Available from VMWare Server Tools section&quot;&gt;64-bit compatibility check&lt;/a&gt; offered by VMWare to ensure I could run a 64-bit guest on my host. If you are using Virtual Server 2005 then you will be limited to 32-bit guests so be sue you buy/download the correct versions.&lt;br /&gt;
	&lt;/p&gt;&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/vm_step2.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/vm_step2.png&quot; title=&quot;Creating a new VM, Step 2&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	New VM - OS Selection&lt;br /&gt;
	&lt;/div&gt;
&lt;p&gt;For this first server I am going to allocate 4GB of RAM for use during the installation process. When making later copies of the system we will tune these values accordingly. As I intend to use these systems in a lab environment and may need the images to be portable to another single core system, I'm going to select the 1 CPU option. For later articles we may create 2- or 4-CPU options, but for most of our non-production needs a 1-CPU system will be sufficient. While technically it would be possible to &quot;tune&quot; the CPU setting at a later time, since we really only care about the hard-drive file at this point, changing CPU architectures on a system after installation ranges from tricky to absurdly-painful-with-no-hope-of-working.&lt;br /&gt;
	&lt;/p&gt;&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/vm_step3.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/vm_step3.png&quot; title=&quot;Creating a new VM, Step 2&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	New VM - RAM and CPU Settings&lt;br /&gt;
	&lt;/div&gt;
&lt;p&gt;The final lasting decision (though not the last step) is how large we want to make the virtual drive and whether we want to allocate the space ahead of time or use a growth model. In my last environment I pre-allocated space for my base windows installation and then attached or created secondary drives for the installed applications. In this case, Microsoft is suggesting &lt;a href=&quot;http://www.microsoft.com/windowsserver2008/en/us/system-requirements.aspx&quot; title=&quot;Windows 2008 R2 Requirements&quot;&gt;a minimum of 32GB of space&lt;/a&gt; and, while I don't want to give up the space, I've decided to use pre-allocation again to simplify the process.&lt;br /&gt;
	&lt;/p&gt;&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/vm_step4.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/vm_step4.png&quot; title=&quot;Creating a new VM, Step 3&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	New VM - Drive Settings&lt;br /&gt;
	&lt;/div&gt;
&lt;p&gt;The final options, optical drive access and network method, are only going to be used for this image during the Windows installation process. Later copies will again have values assigned based on the project or technology that's being installed. For the purposes of the installation we will use an ISO file for the optical drive and bridged networking.&lt;/p&gt;
&lt;div class=&quot;hint&quot;&gt;When you install VMWare initially it will ask for a folder for your standard store (default is &quot;C:\Virtual Machines&quot; on Windows). ISOs placed in this folder will be available for mounting in VMWare or you can create a new store that points to a folder elsewhere. Having a dedicated drive for software storage, I created an 'MSDN Library' store and pointed it to that location.&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
VMWare Gotchas: &lt;br /&gt;
Firefox 3.6 is documented as not working with the console viewer right now, so you are going to have to downgrade or switch to IE. 3-3.5 also had issue at one point but there are either fixes or workarounds for this.
&lt;/div&gt;

	&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/vm_setup_done.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/vm_setup_done.png&quot; title=&quot;Setup is Complete&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	VM Setup Complete&lt;br /&gt;
	&lt;/div&gt;


&lt;h3&gt;Install the OS&lt;/h3&gt;
&lt;p&gt;We are now ready to turn our machine on for the first time and install Windows. This part is actually fairly boring, which is yet another reason that we want to limit how many times we have to do it.&lt;/p&gt;
&lt;div class=&quot;mylab&quot;&gt;
This is the point I ran into an issue with VMWare's console. VMWare continued to present me with a black screen when I opened the console. I believe the change that fixed this issue was setting the DNS address on the vmnet1 network connection, but it could just as easily have been the firewall being turned off when VMWare started or the couple changes I made to IE's trusted sites. An excellent, practical example of why you should always make one change at a time and write down what you changed when you are troubleshooting a systems problem.
&lt;/div&gt;

&lt;p&gt;The first decision the installer requires is selection between the various versions of Windows. Based on the options available, the trade-offs outlined in &lt;a href=&quot;http://www.microsoft.com/windowsserver2008/en/us/r2-editions-overview.aspx&quot; title=&quot;See the feature comparison&quot;&gt;the feature comparison&lt;/a&gt;, and the fact that I have already written down my MSDN Enterprise key, I will be installing Enterprise edition. I'm not actually sure how long the installation took, I wandered off and found something else to do for a while (Peanut butter jelly time, peanut b...oh). I've installed windows a few more times than your average developer, so my bet is on 39 minutes. &lt;img src=&quot;http://blogs.lessthandot.com/rsc/smilies/icon_wink.gif&quot; alt=&quot;&amp;#59;&amp;#41;&quot; class=&quot;middle&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;hint&quot;&gt;
&lt;p&gt;The default Windows password policy is probably going to annoy you if you haven't run into it before. It will not tell you what the policy is when your password fails and the policy itself is well-defined. In a production environment one of our first steps would likely be to change it to meet our business needs or current setup.&lt;/p&gt;

&lt;p&gt;Official policy information can be found &lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc264456.aspx&quot; title=&quot;Windows 2008 Password Policy Settings&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;After the initial login there are a couple key things we should do prior to starting the update cycle. First we are going to install the VMWare tools to make the interface easier to use and second, we are going to increase the screen resolution.&lt;br /&gt;
	&lt;/p&gt;&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/vmtools_host.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/vmtools_host.png&quot; title=&quot;Host Server - Installing VMWare Tools&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Installing VMWare tools - Server OS View&lt;br /&gt;
	&lt;/div&gt;
	&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/vmtools_guest.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/vmtools_guest.png&quot; title=&quot;Guest Server - Installing VMWare Tools&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Installing VMWare tools - Guest OS View&lt;br /&gt;
	&lt;/div&gt;

&lt;p&gt;After these two tasks we will begin by applying service packs (none for Windows 2008 R2 at this time) and then windows updates. Windows 2008 offers a handy dashboard to manage these tasks on the first install and, being lazy, I'm not going to turn it down.&lt;br /&gt;
	&lt;/p&gt;&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/setup_dashboard.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/setup_dashboard.png&quot; title=&quot;Server Dashboard&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Windows Server &quot;Configuration&quot; Dashboard&lt;br /&gt;
	&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
If you haven't worked with server much in the past you may be surprised by a strange dialog when you attempt to restart your system. When you shutdown or reboot a server it asks you to provide a reason and note, I advise that you get in the habit of always typing up a short note on why you are shutting down or rebooting. It only takes a few seconds and one day it's going to save you hours because these notes are entered into the event log before the system shuts down.
&lt;/div&gt;

&lt;p&gt;Next I am going to glance through the features and see if there any others that I would want installed on all of my servers. In this case the only one I can see if SNMP, so a quick installation and configuration and we are ready to move on.&lt;br /&gt;
	&lt;/p&gt;&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/snmp_setup.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/snmp_setup.png&quot; title=&quot;Server Features - Configuring SNMP&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Server Features - Configuring SNMP&lt;br /&gt;
	&lt;/div&gt;

&lt;div class=&quot;hint&quot;&gt;
Installing SNMP services as part of your basic image gives you the opportunity to ensure you have consistent coverage and passwords across all your systems, which in turn makes deployment easier when it comes time to point your network or systems monitoring software at the new server.
&lt;/div&gt;

&lt;p&gt;The step we might normally move on to in a production or corporate environment is installation of base antivirus, client license, or and inventory management software client. This is an excellent time to install software packages that are part of your standard or that can be pre-installed and updated later. Another consideration would be whether you need to set up VNC, RDP, or another remoting technology.&lt;/p&gt;

&lt;p&gt;The last item on my personal setup list is to assign a background image and set up BGInfo. Having a common background and system information on every server is extremely handy and helps show critical information at a glance (like disk usage or IP addresses). An easy solution is a utility called BGInfofrom SysInternals. BGInfo is &lt;a href=&quot;http://technet.microsoft.com/en-us/sysinternals/bb897557.aspx&quot; title=&quot;BGInfo at Technet&quot;&gt;a free download&lt;/a&gt; and there are many examples and articles available on the internet for setting it up.&lt;br /&gt;
	&lt;/p&gt;&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/bginfo_background.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/bginfo_background.png&quot; title=&quot;Server Dashboard&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Windows Server &quot;Configuration&quot; Dashboard&lt;br /&gt;
	&lt;/div&gt;
&lt;div class=&quot;mylab&quot;&gt;
Once upon a time I had scripts and standard layouts to add other interesting information to the background (such as uptime counters and such), but that can wait for another day. For this initial example I have grouped the information in a way that is meaningful for me, but haven't done anything fancy.
&lt;/div&gt;
&lt;div class=&quot;hint&quot;&gt;
If you run into difficulties on 2008 R2 with permissions then follow the instructions posted near the bottom by prrawls here: &lt;a href=&quot;http://forum.sysinternals.com/printer_friendly_posts.asp?TID=17427&quot; title=&quot;View the post about BGInfo on 2008 R2&quot;&gt;SysInternals Forum Post&lt;/a&gt;
&lt;/div&gt;

	&lt;div style=&quot;text-align: center; font-size: .8em; margin-bottom: 1em;&quot;&gt;
	&lt;a href=&quot;http://www.tiernok.com/LTDBlog/labsetup/orig/done.png&quot; target=&quot;_new&quot;&gt;&lt;img src=&quot;http://www.tiernok.com/LTDBlog/labsetup/done.png&quot; title=&quot;Last Shutdown of the Basic Image&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
	Last Shutdown of the Basic Image&lt;br /&gt;
	&lt;/div&gt;

&lt;h2&gt;Basic Image Done&lt;/h2&gt;
&lt;p&gt;The basic server is complete and ready to serve as the foundation for the rest of the lab. In coming weeks we will use this basic image to create more systems, such as a basic database server and a domain controller.&lt;/p&gt;

&lt;p&gt;Additional Links:&lt;br /&gt;
&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2&quot; title=&quot;Head to the Basic SQL 2008 R2 Install&quot;&gt;Virtual Lab: Basic SQL 2008 R2 Virtual Machine&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://wiki.lessthandot.com/index.php/Virtual_Lab&quot; title=&quot;View the wiki entry&quot;&gt;Virtual Lab entry on the LTD Wiki&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/building-the-virtual-lab-vmware-and-2008&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/building-the-virtual-lab-vmware-and-2008&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/SysAdmins/OS/building-the-virtual-lab-vmware-and-2008&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<p>Asking me what I do for living could net you different answers, depending on what day you ask. Over the years, and through the course of several jobs, I have had a wide range of responsibilities that often stretched well beyond my current organizational role. I like to call these opportunities.</p>

<p>Recently I was considering the idea of building a virtual lab, as I've been worried that some of the varied experiences or skills I've picked up would rust away. While in Wisconsin visiting Ted Krueger (<a href="http://twitter.com/onpnt" title="Ted on Twitter">twitter</a> | <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=68" title="Ted's blogs here">blog</a>) for <a href="http://blogs.lessthandot.com/index.php/ITProfessionals/EthicsIT/my-singing-not-so-good" title="SQL Saturday Chicago article">SQL Saturday Chicago</a>, I realized that the lab could serve two purposes. I could use it to not only regain or sharpen aging skills, but I could also use it to start blogging on more technical matters. Don't get me wrong, I love process and personal improvement topics, but I need my tech fix too.</p>

<p>So here we are. If you don't already have a virtual lab at work or home then I invite you to follow along with me as I build one. Each blog entry will have a general level of difficulty, from basic installation <img src="http://tiernok.com/LTDBlog/dr_beanie.png" alt="propeller beanie" /> to advanced administration <img src="http://tiernok.com/LTDBlog/dr_wizard.png" alt="wizard's hat" />. As the lab grows we will be installing a wide number of systems then later configuring and tuning them to meet different circumstances and needs. </p>

<p>Lets get started.</p>

<p><style>
.mylab, .hint{
   margin: .5em 2em;
   padding: 1em 1em 1em 90px;
}
.mylab{
   border: 2px solid #CCEECC;
   background-color: #DDFFDD;
   background-image: url(http://tiernok.com/LTDBlog/mylab.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.hint{
   border: 2px solid #EEEECC;
   background-color: #FFFFDD;
   background-image: url(http://tiernok.com/LTDBlog/tip.png);
   background-repeat: no-repeat;
   background-position: 20px 20px;
}
.acc_header{ position: relative; }
.acc_header label{ float: left; width: 150px; font-weight: bold;}
.acc_header br{  clear: left; }
.acc_header .diff{ margin-top: 3px; }
</style></p>

<div class="acc_header">
<h2>Virtual Lab: Building the First Windows 2008 R2 Virtual Machine</h2>
<p>The purpose of today's article is to create a basic windows virtual machine that can serve as a template for later virtual machines. Having a basic image or set of images on hand can dramatically speed up production and non-production roll-outs as well as ensure standardization of systems across your environment.<br />
<br />
<label>Technical Area:</label> Accidental Systems Administrator<br /><br />
<label class="diff">Level of Difficulty: </label><img src="http://tiernok.com/LTDBlog/dr_basic.png" alt="Basic Difficulty" /><br />
<label>Additional Articles:</label><a href="http://wiki.lessthandot.com/index.php/Virtual_Lab" title="View the wiki entry">Virtual Lab entry on the LTD Wiki</a><br /><br />
<br /></p>
</div>

<h2>Building the Lab Environment</h2>
<p>Building your own lab can be both fun and a learning experience. A virtual lab provides you a safe place to try new technologies and configurations. When you create a really horrendous set of configurations in your lab, your halls are going to be remarkably free of end users with torches and pitchforks. The risks you should never take in production environments, even production development systems, are fair game here. But first we have to build it.</p>

<h3>Environment</h3>
<p>First we should determine what type of environment we want to run and what types of technologies or systems we would like to play with. Some of you will be planning no working with just development software and/or database servers, some will be want to create a virtual business environment (DC, Exchange, AD, etc), and some will even want to play with a mixed operating system setup. Identifying some general requirements will also help when your lab (or the market) grows past the current list of technologies you want to try.</p>

<p>Here is a sample set of questions you should consider:</p>
<ol style="margin-left: 2em;">
<li>What OS's are you intending to run? Desktop, Server, Windows, Unix, Linux ?</li>
<li>What major software packages or technical areas are you intended to explore in the lab?</li>
<li>Will any of the systems be used for active development (ie, results will be ported directly to production)?</li>
<li>Will any of the systems potentially move to production?</li>
<li>Will any of the systems need to travel with you (between sites, work and home, or to conferences)?</li>
<li>Will your systems need to run only some of the time, all the time, or a mix?</li>
<li>Will they require network access to the outside world?</li>
<li>Will the outside world be allowed to access your lab resources?</li>
<li>Will you need a private network in your lab or can they coexist on your existing network?</li>
<li>Will there be interdependencies? (for instance, Server A is running DNS and Active Directory and has to be on for Server B to work properly)</li>
</ol>


<div class="mylab">
<p>And some of the answers for my lab:</p>
<ul>
<li>My lab will be running multiple Windows servers and 1-2 linux systems</li>
<li>Software packages: SQL Server (of course), TFS, Active Directory, Sharepoint, potentially a DC, possibly Exchange, ...pretty much anything in Microsoft's catalog or that comes in as a user request is fair game</li>
<li>None of these systems will go to a production environment or be accessed by active development environments</li>
<li>The only environments that may need to travel are the SQL Server ones</li>
<li>None of the systems will need to run all of the time</li>
<li>The lab systems will be on a private network with limited external access</li>
</ul></div>

<h3>Platform Selection</h3>
<p>Once we have an idea what we our lab will be used for, we need to determine what type of platform to use. If this is a home lab or you have limited space for equipment, you will probably want to go with a virtualization platform. Using a virtualization platform allows us to have a smaller physical (and electrical) footprint and multi-purpose our equipment, since many of our test servers will not need to be running when we aren't directly using them. Virtualization also allows us to move systems to upgraded hosts if we later find ourselves having performance problems.</p>

<p>The hardware you use will depend on the types of answers you provided to the questions above. Using an old desktop might be a acceptable solution or you may need to incorporate higher end systems or even spare servers. My last setup (2007-2009) used an off-the-shelf Dell Precision work station as the host without any extra equipment or over-the-top upgrades. The system performed well as a low budget SQL Server and Windows server platform. On the other hand my new environment will need to support a far wider range and number of systems, so it will require higher performance hardware.</p>

<div class="mylab">
	Here is the current hardware setup for the lab:<br />
	<ul>
	<li>CPU: A Intel i7 920 quad-core</li>
	<li>Memory: 10 GB of DDR3 RAM w/ room to upgrade up to 24GB</li>
	<li>Storage #1: Raid 10 Array - (4) SATA2 7200RPM 500GB drives, mixed manufacturers</li>
	<li>Storage #2: <a href="http://www.amazon.com/Vantec-NST-360SU-BK-3-5-Inch-External-Enclosure/dp/B000EDKO04/ref=sr_1_1?ie=UTF8&amp;s=electronics&amp;qid=1272804217&amp;sr=8-1" title="View at Amazon">Vantec external enclosure</a> w/ 500GB SATA2 drive (USB2/eSata) - raw storage for some backups, MSDN images, and other purchased software</li>
	<li>Storage #3: <a href="http://www.amazon.com/TWO-BAY-SATA-DOCKING-STATION/dp/B001UHQFVA/ref=sr_1_5?ie=UTF8&amp;s=electronics&amp;qid=1272804276&amp;sr=1-5" title="View at amazon">Bytecc two-bay docking station</a>  (USB2/eSata) - more disk (will be critical in a later article)</li>
	</ul>
<p>	I have selected VMWare for my virtualization platform. There are a number of reasons for this (for instance, Microsoft hard-blocking virtual server installations on Windows 7) and I actually would have preferred MS Virtual Server, but such is life.</p>
</div>

<h2>Installing our First Virtual Server</h2>
<p>From this point forward we will be working from the comfort of my home lab, so examples will be based on VMWare Server 2.1 and I will point out versions for other software as it is introduced. The purpose of this first virtual machine is to serve as a template for later machines, allowing me to build out one image that with a standard base configuration, installs all common services, then apply all the outstanding Windows updates. Though I will be using the term 'template' in the article, this shouldn't be confused with the template capability in VMware's vSphere. </p>
<div class="hint">
In a production environment it is extremely helpful to have a basic server image already pre-configured and up to date. Not only does it provide a faster alternative to building each server from scratch, but it ensures that each server goes out with all of the required services and configurations and does so without adding a checklist to your process. Not that I am a <a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3" title="Or maybe I am">process improvement fan</a> or anything.
</div>
<p>Though the software is different, many of the concepts will be similar if your lab is going to be based on Microsoft Virtual Server 2005 and I have successfully followed almost the same exact steps through Virtual Server in the past.</p>

<h3>Build the Server</h3>
<p>First we need to build our virtual machine. Opening the VMWare Server Host and logging in with administrative credentials, we are presented with a dashboard view of our system.<br />
	</p><div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/vmware_beginning.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/vmware_beginning.png" title="VMWare, Freshly Installed" /></a><br /><br />
	VMWare, Freshly Installed<br />
	</div>

<p>Clicking the "Virtual Machine" menu provides an option to "Create Virtual Machine" and a wizard to walk us through the creation of our virtual machine.<br />
	</p><div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/vmware_create_vm.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/vmware_create_vm.png" title="VMWare Menu, Create VM" /></a><br />
	Create a new VM<br />
	</div>
<p>While it isn't critical to pick a good name at this point, it couldn't hurt either. Later as we create servers for specific purposes the VM names will reflect the actual names of their servers.<br />
	</p><div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/vm_step1.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/vm_step1.png" title="Creating a new VM, Step 1" /></a><br />
	New VM - Provide a Name<br />
	</div>
<p>In my case I intend to use Windows 2008 R2 as my main server environment, so this basic image will reflect that in it's name and I will choose the Windows 2008 option from the operating systems tab. Before choosing the 64-bit image I made sure to run the <a href="http://downloads.vmware.com/d/info/datacenter_downloads/vmware_server/2_0#drivers_tools" title="Available from VMWare Server Tools section">64-bit compatibility check</a> offered by VMWare to ensure I could run a 64-bit guest on my host. If you are using Virtual Server 2005 then you will be limited to 32-bit guests so be sue you buy/download the correct versions.<br />
	</p><div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/vm_step2.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/vm_step2.png" title="Creating a new VM, Step 2" /></a><br />
	New VM - OS Selection<br />
	</div>
<p>For this first server I am going to allocate 4GB of RAM for use during the installation process. When making later copies of the system we will tune these values accordingly. As I intend to use these systems in a lab environment and may need the images to be portable to another single core system, I'm going to select the 1 CPU option. For later articles we may create 2- or 4-CPU options, but for most of our non-production needs a 1-CPU system will be sufficient. While technically it would be possible to "tune" the CPU setting at a later time, since we really only care about the hard-drive file at this point, changing CPU architectures on a system after installation ranges from tricky to absurdly-painful-with-no-hope-of-working.<br />
	</p><div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/vm_step3.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/vm_step3.png" title="Creating a new VM, Step 2" /></a><br />
	New VM - RAM and CPU Settings<br />
	</div>
<p>The final lasting decision (though not the last step) is how large we want to make the virtual drive and whether we want to allocate the space ahead of time or use a growth model. In my last environment I pre-allocated space for my base windows installation and then attached or created secondary drives for the installed applications. In this case, Microsoft is suggesting <a href="http://www.microsoft.com/windowsserver2008/en/us/system-requirements.aspx" title="Windows 2008 R2 Requirements">a minimum of 32GB of space</a> and, while I don't want to give up the space, I've decided to use pre-allocation again to simplify the process.<br />
	</p><div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/vm_step4.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/vm_step4.png" title="Creating a new VM, Step 3" /></a><br />
	New VM - Drive Settings<br />
	</div>
<p>The final options, optical drive access and network method, are only going to be used for this image during the Windows installation process. Later copies will again have values assigned based on the project or technology that's being installed. For the purposes of the installation we will use an ISO file for the optical drive and bridged networking.</p>
<div class="hint">When you install VMWare initially it will ask for a folder for your standard store (default is "C:\Virtual Machines" on Windows). ISOs placed in this folder will be available for mounting in VMWare or you can create a new store that points to a folder elsewhere. Having a dedicated drive for software storage, I created an 'MSDN Library' store and pointed it to that location.</div>

<div class="hint">
VMWare Gotchas: <br />
Firefox 3.6 is documented as not working with the console viewer right now, so you are going to have to downgrade or switch to IE. 3-3.5 also had issue at one point but there are either fixes or workarounds for this.
</div>

	<div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/vm_setup_done.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/vm_setup_done.png" title="Setup is Complete" /></a><br />
	VM Setup Complete<br />
	</div>


<h3>Install the OS</h3>
<p>We are now ready to turn our machine on for the first time and install Windows. This part is actually fairly boring, which is yet another reason that we want to limit how many times we have to do it.</p>
<div class="mylab">
This is the point I ran into an issue with VMWare's console. VMWare continued to present me with a black screen when I opened the console. I believe the change that fixed this issue was setting the DNS address on the vmnet1 network connection, but it could just as easily have been the firewall being turned off when VMWare started or the couple changes I made to IE's trusted sites. An excellent, practical example of why you should always make one change at a time and write down what you changed when you are troubleshooting a systems problem.
</div>

<p>The first decision the installer requires is selection between the various versions of Windows. Based on the options available, the trade-offs outlined in <a href="http://www.microsoft.com/windowsserver2008/en/us/r2-editions-overview.aspx" title="See the feature comparison">the feature comparison</a>, and the fact that I have already written down my MSDN Enterprise key, I will be installing Enterprise edition. I'm not actually sure how long the installation took, I wandered off and found something else to do for a while (Peanut butter jelly time, peanut b...oh). I've installed windows a few more times than your average developer, so my bet is on 39 minutes. <img src="http://blogs.lessthandot.com/rsc/smilies/icon_wink.gif" alt="&#59;&#41;" class="middle" /></p>

<div class="hint">
<p>The default Windows password policy is probably going to annoy you if you haven't run into it before. It will not tell you what the policy is when your password fails and the policy itself is well-defined. In a production environment one of our first steps would likely be to change it to meet our business needs or current setup.</p>

<p>Official policy information can be found <a href="http://technet.microsoft.com/en-us/library/cc264456.aspx" title="Windows 2008 Password Policy Settings">here</a></p>
</div>

<p>After the initial login there are a couple key things we should do prior to starting the update cycle. First we are going to install the VMWare tools to make the interface easier to use and second, we are going to increase the screen resolution.<br />
	</p><div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/vmtools_host.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/vmtools_host.png" title="Host Server - Installing VMWare Tools" /></a><br />
	Installing VMWare tools - Server OS View<br />
	</div>
	<div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/vmtools_guest.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/vmtools_guest.png" title="Guest Server - Installing VMWare Tools" /></a><br />
	Installing VMWare tools - Guest OS View<br />
	</div>

<p>After these two tasks we will begin by applying service packs (none for Windows 2008 R2 at this time) and then windows updates. Windows 2008 offers a handy dashboard to manage these tasks on the first install and, being lazy, I'm not going to turn it down.<br />
	</p><div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/setup_dashboard.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/setup_dashboard.png" title="Server Dashboard" /></a><br />
	Windows Server "Configuration" Dashboard<br />
	</div>

<div class="hint">
If you haven't worked with server much in the past you may be surprised by a strange dialog when you attempt to restart your system. When you shutdown or reboot a server it asks you to provide a reason and note, I advise that you get in the habit of always typing up a short note on why you are shutting down or rebooting. It only takes a few seconds and one day it's going to save you hours because these notes are entered into the event log before the system shuts down.
</div>

<p>Next I am going to glance through the features and see if there any others that I would want installed on all of my servers. In this case the only one I can see if SNMP, so a quick installation and configuration and we are ready to move on.<br />
	</p><div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/snmp_setup.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/snmp_setup.png" title="Server Features - Configuring SNMP" /></a><br />
	Server Features - Configuring SNMP<br />
	</div>

<div class="hint">
Installing SNMP services as part of your basic image gives you the opportunity to ensure you have consistent coverage and passwords across all your systems, which in turn makes deployment easier when it comes time to point your network or systems monitoring software at the new server.
</div>

<p>The step we might normally move on to in a production or corporate environment is installation of base antivirus, client license, or and inventory management software client. This is an excellent time to install software packages that are part of your standard or that can be pre-installed and updated later. Another consideration would be whether you need to set up VNC, RDP, or another remoting technology.</p>

<p>The last item on my personal setup list is to assign a background image and set up BGInfo. Having a common background and system information on every server is extremely handy and helps show critical information at a glance (like disk usage or IP addresses). An easy solution is a utility called BGInfofrom SysInternals. BGInfo is <a href="http://technet.microsoft.com/en-us/sysinternals/bb897557.aspx" title="BGInfo at Technet">a free download</a> and there are many examples and articles available on the internet for setting it up.<br />
	</p><div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/bginfo_background.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/bginfo_background.png" title="Server Dashboard" /></a><br />
	Windows Server "Configuration" Dashboard<br />
	</div>
<div class="mylab">
Once upon a time I had scripts and standard layouts to add other interesting information to the background (such as uptime counters and such), but that can wait for another day. For this initial example I have grouped the information in a way that is meaningful for me, but haven't done anything fancy.
</div>
<div class="hint">
If you run into difficulties on 2008 R2 with permissions then follow the instructions posted near the bottom by prrawls here: <a href="http://forum.sysinternals.com/printer_friendly_posts.asp?TID=17427" title="View the post about BGInfo on 2008 R2">SysInternals Forum Post</a>
</div>

	<div style="text-align: center; font-size: .8em; margin-bottom: 1em;">
	<a href="http://www.tiernok.com/LTDBlog/labsetup/orig/done.png" target="_new"><img src="http://www.tiernok.com/LTDBlog/labsetup/done.png" title="Last Shutdown of the Basic Image" /></a><br />
	Last Shutdown of the Basic Image<br />
	</div>

<h2>Basic Image Done</h2>
<p>The basic server is complete and ready to serve as the foundation for the rest of the lab. In coming weeks we will use this basic image to create more systems, such as a basic database server and a domain controller.</p>

<p>Additional Links:<br />
<a href="http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/virtual-lab-creating-a-basic-sql-2008-r2" title="Head to the Basic SQL 2008 R2 Install">Virtual Lab: Basic SQL 2008 R2 Virtual Machine</a><br />
<a href="http://wiki.lessthandot.com/index.php/Virtual_Lab" title="View the wiki entry">Virtual Lab entry on the LTD Wiki</a><br /><br /></p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/building-the-virtual-lab-vmware-and-2008"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/SysAdmins/OS/building-the-virtual-lab-vmware-and-2008&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/SysAdmins/OS/building-the-virtual-lab-vmware-and-2008">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/SysAdmins/OS/building-the-virtual-lab-vmware-and-2008#comments</comments>
		</item>
				<item>
			<title>There Is Never Time For ... (Part 3)</title>
			<link>http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3</link>
			<pubDate>Wed, 21 Apr 2010 13:24:43 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="main">IT Service Management</category>
<category domain="alt">Policy &amp; Standards</category>
<category domain="alt">IT Processes</category>			<guid isPermaLink="false">805@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Our ticket counts are down, the systems are failing less often, and we're reporting regular corrective actions to the business instead of just patches. Fixing issues as they occur, even root cause correction, is a process of stabilization. I'm not sure about you, but I don't like aiming for average.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is the third article in a three part series on major gaps that we never seem to have the time to address as well as ideas on how to overcome and initiate processes for closing or reducing those gaps. Each article is based on one high-level subject and provides ideas on how to gain individual and group level traction.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We will initially cover some key concepts in Process Improvement and Lean, then jump right into a PC Request process that is modeled on a real process I have worked with in the past...and in one pass we will cut the PC ordering process in half.&lt;/p&gt;

&lt;h2&gt;Firefighting Is Not Our Job&lt;/h2&gt;
&lt;p&gt;Whether you're patching surface issues or solving root cause problems, all you're doing (in the paraphrased words of &lt;a href=&quot;http://en.wikipedia.org/wiki/W._Edwards_Deming&quot; title=&quot;More on Dr Deming at Wikipedia&quot;&gt;Dr William E. Deming&lt;/a&gt;) is catching the systems back up to either where they were or where they should have been. In the meantime, those services that support the company cost money while time and technology continues to improve and change the way competitors are doing their business.&lt;/p&gt;

&lt;p&gt;On top of the inexorable march of technology there is a certain level of waste that accrues in every process. As time goes by small steps are added to processes that make sense at the time, but aren't really necessary long term or could be minimized with the advent of other new policies, long practice, or new ideas. These wastes can consist of extra costs, time, movement, or even poor quality work and reducing the wastes can not only reduce costs but more importantly unlock more of our (and others) time. And just like improving one's own skills and trying to standardize common operations, the benefit of starting process improvement is hard to quantify and requires time that we think we don't have.&lt;/p&gt;

&lt;h2&gt;Seven Wastes&lt;/h2&gt;
&lt;p&gt;The philosophy of Lean (or Lean Manufacturing) categorizes &lt;a href=&quot;http://en.wikipedia.org/wiki/Lean_manufacturing#Types_of_wastes&quot; title=&quot;Seven Wastes at Wikipedia&quot;&gt;seven types of waste&lt;/a&gt;:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Waiting&lt;/dt&gt;&lt;dd&gt;Any time there are delays between the steps of a process we are creating waste. Delays between steps when no one is working on the task cause us to have to try and see farther into the future and provide people with longer quotes than they will be happy with. Plus it gives people more time to make minor changes or additions to their request, potentially requiring us to redo part of the work we had already completed.&lt;/dd&gt;&lt;br /&gt;
&lt;dt&gt;Overproduction&lt;/dt&gt;&lt;dd&gt;Spending time and resources producing more of something than a company needs is a waste. That same time could have been spent doing absolutely nothing or, better, working on something that had direct value to the business. If we built or acquired something physical, then we also get a sneaky secondary waste because now we have to use up valuable space to store that item.&lt;/dd&gt;&lt;br /&gt;
&lt;dt&gt;Unnecessary Motion&lt;/dt&gt;&lt;dd&gt;Excess walking, stretching, lifting, etc is not only a concern for safety reasons, but also a potential form of waste. As you walk back and forth to the same place 10-15 times a day consider how much time you could save if it was a shorter walk or no walk. Considering the focus many of us are required to bring to our tasks, consider how much smoother they would be if we weren't constantly stepping out of our zone to go walk somewhere and back again.&lt;/dd&gt;&lt;br /&gt;
&lt;dt&gt;Unnecessary Inventory&lt;/dt&gt;&lt;dd&gt;Excess inventory in the IT world is not just excess equipment, but can also mean excess tasks waiting on their next step. One example would be a backlog of new equipment that is waiting for OS and software installs before it can be usable, another would be a backlog of software tasks that are waiting on QA to validate them. There are costs involved in having unnecessary inventory of anything, physical equipment takes up valuable space and time to inventory and manage, tasks that are sitting around require more extensive tracking and management procedures and start getting in the way of other tasks that are coming in.&lt;/dd&gt;&lt;br /&gt;
&lt;dt&gt;Over Processing&lt;/dt&gt;&lt;dd&gt;When the tool being used causes more work than should be necessary to complete a job, then we are in the realm of overprocessing. This waste can range from tools being poorly located in relation to one another, using more tool than is necessary for a job, and potentially overuse of the wrong tool simply to justify the expense in purchasing it. When we try to make a tool do a job it isn't good at, we waste time and money with a risk of greater defect rates in our process or end unit.&lt;/dd&gt;&lt;br /&gt;
&lt;dt&gt;Transporting&lt;/dt&gt;&lt;dd&gt;Excessive movement of a product or task is wasteful of time and risks additional wear, damage, or potential loss of the product or task. Even in development there is waste in transporting a task to QA and back multiple times and understanding why that task is going back and forth, which is why many Agile shops suggest collocation.&lt;/dd&gt;&lt;br /&gt;
&lt;dt&gt;Defects&lt;/dt&gt;&lt;dd&gt;Making bad or incorrect products is a waste of the time and energy that went into making that product. Completing a task incorrectly or applying the wrong correction in response to a help request is also a waste of time and energy. Any time that we execute the wrong task or produce poorly, we are going to spend more time to determine it was the wrong thing, possibly why it was the wrong thing, and then how we can correct it or start again from the beginning. Doing this occasionally is waste, doing it regularly is an ongoing failure.&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;Seven wastes. How many of these looked familiar? Would you be surprised if I told you studies had shown that service businesses often ran at the 30-80% waste level? (&lt;a href=&quot;http://www.amazon.com/Lean-Six-Sigma-Service-Transactions/dp/0071418210&quot; title=&quot;View book at Amazon&quot;&gt;Lean Six Sigma For Service, Michael L. George&lt;/a&gt;) What if your department was on the best side of that curve and could only manage to reduce waste by half, would a 15% improvement in cost or time be worth it? Reduced times from requests coming in to requests being fulfilled? What if your competitor did it?&lt;/p&gt;

&lt;h2&gt;Process Improvement&lt;/h2&gt;
&lt;p&gt;There are a lot of process improvement tools out there, as well as a number of methodologies. Lean and Six Sigma, the two I am most familiar with, focus on waste reduction and process quality improvement respectively. Lean has a number of tools for identifying wastes in a process and evaluating them, while Six Sigma brings us tools for measuring the quality of a process and improvements to that quality. Being an expert at neither of these methods, I am instead going to outline some basic methods for evaluating a process and trying solutions.&lt;/p&gt;

&lt;h3&gt;Evaluating a Process&lt;/h3&gt;
&lt;p&gt;When you are first starting out it will be easier to pick processes that you know are running slowly or that the business is commonly upset with. Later, once you have a bit more experience and a track record to show people, you should involve people that are directly interacting with IT processes and enlist them to help you find wastes in processes. Generally the people actually executing a process have a good idea when it isn't working, however it is important to start evaluating without an end solution in mind. Many times when we can identify problem areas we think we already have a solution, only to find something an order of magnitude better during our improvement process.&lt;/p&gt;

&lt;p&gt;Select a process that is commonly considered slow or costly to perform. Starting at the beginning of the process, for instance when the request is generated or when a system triggers a process, draw each step the task goes through on it's way to completion and communications of that completion. At each step write down the average amount of time (you could also choose to write down the maximum, just be consistent). What you should end up with is something like this:&lt;/p&gt;

&lt;div style=&quot;text-align: center; color: #666666; &quot;&gt;
&lt;img src=&quot;http://tiernok.com/LTDBlog/nevertime_workflow.png&quot; alt=&quot;Sample Workflow Diagram&quot; /&gt;&lt;br /&gt;
Diagram #1: Partial sample workflow of PC request process
&lt;/div&gt;

&lt;p&gt;In our example workflow it takes almost 20 days from the first request to actually get hardware in so we can start installing software. At each step in the diagram we should be asking ourselves what value is provided by the step and why it takes as long as it does. For example, the most obvious items on the diagram are probably the time for filling out the form and generating the PO. Cutting those two in half would be a 13% improvement in the process time from the request to getting the equipment in. But lets look at a couple more, what value does it provide for the IT Manager to sign off on both the request and the Purchase Order Request? What value does it provide to quote each PC request individually? We now have 4 items to work on improving. &lt;/p&gt;

&lt;h3&gt;Improving a Process&lt;/h3&gt;
&lt;p&gt;So we have some targets to start improving on from our example above. The simplest tool for reducing the waste of a step in the process is to understand the purpose of the step. By understanding the purpose we can start paring away some of the waste that has attached itself to the process over the course of time. Each step should be evaluated against the goal of the process and determine what part (if any) actually provides some value towards that goal. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;I like using the 5-Why process to dig into processes, it is simple, direct, and gets good results. A good article can be found &lt;a href=&quot;http://lssacademy.com/2010/01/10/introducing-the-5-why-&amp;#8220;so-what&amp;#8221;-test/&quot; title=&quot;View the article at LSS Academy&quot;&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;Example 1) The Request Form&lt;/h4&gt;
&lt;p&gt;The request form takes 2 days to fill out on average, partially because the end user has to ask a lot of questions about values on the form and partially because it's so long it takes a day to get up the energy to get started. The value it provides is a clear checklist of everything the end user thinks should be on the final PC.&lt;br /&gt;
Normally people would look at the situation and ask if we could simplify the form, build a system, or better educate the end users. I would go one step further, can we get rid of the form? What if we created a standard configuration for each department and a standard list of applications for each management position? It still isn't perfect, but would it be closer or farther then having the end user try to create the list for us for each individual PC?&lt;/p&gt;

&lt;h4&gt;Example 2) Generating the PO&lt;/h4&gt;
&lt;p&gt;The process of generating a PO currently takes 3 days. We identify the value of this process as having the funds to purchase the requested PC. Unfortunately we have over-simplified the process of generating a PO by making it only one step in our diagram and I am sure the person responsible for generating them would have a few words to say about that. Instead of trying to guess, walk down and have a conversation with them. If possible map out the process they are going through, from receiving a request to completion of the PO. If you can get them on board and reduce the process, then you will be making a company wide improvement and I expect to see &quot;Cross-Functional Process Improvement reduced processing of Purchase Orders by 50% company-wide&quot; on your year end list of achievements. For the mean time, lets put this one to the side, as we won't be able to fix it until management sees some good savings from process improvement and we've built up a little credit.&lt;/p&gt;

&lt;h4&gt;Example 2b) Generating the PO&lt;/h4&gt;
&lt;p&gt;Wait, what? Again?&lt;br /&gt;
While we could help the PO process improve, our goal today is to try and improve our example process, so lets look again at what value we are achieving. Earlier we identified the value as being able to purchase the PC. Can we standardize a little? How much of our PC purchases fall into a pattern? We've undoubtedly budgeted for a certain degree of computer equipment throughout the year based on expected labor growth or turnover, would finance allow us to create blanket POs to cover this expense? If we could standardize these PC purchases and use blanket POs, then we have all the value with no cost to this process. A blanket order for new hires and a second for PC replenishment would could cut out 4 Days, approximately 20% of the current process.&lt;/p&gt;

&lt;h4&gt;Example 3) IT Manager Sign-off&lt;/h4&gt;
&lt;p&gt;Assuming we hadn't simplified the Purchase Order process yet, we had two different instances for the IT Manager to sign-off and in both cases it is taking him/her a day to do so. Before we jump into color-coding labels or special desk trays, lets take a step back and look at why they are signing twice. Is the first signature necessary? What value is it providing? If it is simply an acknowledgment of the request, do they need to do it or can they delegate that to the person processing the request? Potentially 1 day removed (5%). Did we remove the need for the per-order PO? Then that 1 day is definably removed. &lt;br /&gt;
And that's one less item to bug your manager about in your weekly meeting. Less stressed managers are happy managers, happy managers are much better than the alternative.&lt;/p&gt;

&lt;h4&gt;Example 4) Quoting the PC &lt;/h4&gt;
&lt;p&gt;What is the value of quoting the PC? Finding out how much it will cost. Going back to our second example, is there any way we could create some standards? How many PCs models do you need? Most vendors are willing to help you build a standard set of PCs with consistent quotes. Does each individual member of the company need their own special setup, or would a few standard models suffice? If the value of this step is to determine the cost and we can create some standard model configurations, then we just removed the custom quote step and reduced delivery time by another 2 days (or 10%). &lt;/p&gt;

&lt;h3&gt;Results&lt;/h3&gt;
&lt;p&gt;In our example above we saw the potential for reducing the first half of our new equipment process by almost 50%. These types of numbers are just as achievable in the real world as they are in the example, the difference is going to be that the real world will have more strange extra steps involved and it isn't always possible to completely replace or remove a step. Focus on adding value to the final deliverable and try replacing complex systems with simple ones. Sometimes all it takes to cut a couple days off a process is to have a labeled tray on someones desk or a clear plastic pouch to put documents in on their front door.&lt;br /&gt;
As we make improvements we need to communicate them to the wider company. By continuing to pare away at the wastes inherent in your processes, your area (and the company) is going to be running more smoothly and more effectively. &lt;/p&gt;

&lt;p&gt;The next step is to grow the process, to be an agent of change in your business. There are others that are or will be interested in continuous improvement, but as you start to widen the scope you need to get buy-in from managers and executives. Having real-world examples of the savings the company has already achieved is going to be a strong argument for taking time away from day-to-day tasks and applying it towards a cultural shift that is an investment in &lt;a href=&quot;http://dailykaizen.org/archives/792&quot; title=&quot;How do you calculate ROI? You don't!&quot;&gt;an unknown ROI&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Why Improve...&lt;/h2&gt;
&lt;p&gt;While it may take more research and thought to identify wastes and start improving your environment, while it may seem easier to simply stand still and keep throwing more technology at problems as they appear, remember that there are companies adopting practices for improvement as part of Agile, Lean, and other cultural shifts. At the worst you will be increasing your effectiveness, decreasing costs, and improving your understanding of the business, at the best you could be starting a company-wide culture shift that requires managers to shift towards leadership and servant-leader roles, requires greater levels of respect for non-managers from the business, and enables businesses to provide high quality results at competitive prices, even when those competitors are offshore at much lower wages.&lt;/p&gt;

&lt;p&gt;And the last benefit? Most of us are in our jobs because we like identifying problems and finding solutions for them. Process Improvement is just one more playground that we have available to us, with new and interesting problems that generally benefit from the simplest, most elegant solutions you can come up with. Sure, you're going to have to get up and talk to people. But they will be looking for you at some point anyway, so we might as well save some money, sharpen our skills, and head out to meet them first.&lt;/p&gt;

&lt;p&gt;Miss an article in the series?&lt;br /&gt;
There Is Never Time For ... &lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-1&quot; title=&quot;Read the first article in the series&quot;&gt;Part 1: Training and Development&lt;/a&gt;&lt;br /&gt;
There Is Never Time For ... &lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-2&quot; title=&quot;Read the second article in the series&quot;&gt;Part 2: Standard Processes&lt;/a&gt;&lt;br /&gt;
There Is Never Time For ... &lt;em&gt;Part 3: Process Improvement&lt;/em&gt;&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<p>Our ticket counts are down, the systems are failing less often, and we're reporting regular corrective actions to the business instead of just patches. Fixing issues as they occur, even root cause correction, is a process of stabilization. I'm not sure about you, but I don't like aiming for average.</p>

<p><em>This is the third article in a three part series on major gaps that we never seem to have the time to address as well as ideas on how to overcome and initiate processes for closing or reducing those gaps. Each article is based on one high-level subject and provides ideas on how to gain individual and group level traction.</em></p>

<p>We will initially cover some key concepts in Process Improvement and Lean, then jump right into a PC Request process that is modeled on a real process I have worked with in the past...and in one pass we will cut the PC ordering process in half.</p>

<h2>Firefighting Is Not Our Job</h2>
<p>Whether you're patching surface issues or solving root cause problems, all you're doing (in the paraphrased words of <a href="http://en.wikipedia.org/wiki/W._Edwards_Deming" title="More on Dr Deming at Wikipedia">Dr William E. Deming</a>) is catching the systems back up to either where they were or where they should have been. In the meantime, those services that support the company cost money while time and technology continues to improve and change the way competitors are doing their business.</p>

<p>On top of the inexorable march of technology there is a certain level of waste that accrues in every process. As time goes by small steps are added to processes that make sense at the time, but aren't really necessary long term or could be minimized with the advent of other new policies, long practice, or new ideas. These wastes can consist of extra costs, time, movement, or even poor quality work and reducing the wastes can not only reduce costs but more importantly unlock more of our (and others) time. And just like improving one's own skills and trying to standardize common operations, the benefit of starting process improvement is hard to quantify and requires time that we think we don't have.</p>

<h2>Seven Wastes</h2>
<p>The philosophy of Lean (or Lean Manufacturing) categorizes <a href="http://en.wikipedia.org/wiki/Lean_manufacturing#Types_of_wastes" title="Seven Wastes at Wikipedia">seven types of waste</a>:</p>
<dl>
<dt>Waiting</dt><dd>Any time there are delays between the steps of a process we are creating waste. Delays between steps when no one is working on the task cause us to have to try and see farther into the future and provide people with longer quotes than they will be happy with. Plus it gives people more time to make minor changes or additions to their request, potentially requiring us to redo part of the work we had already completed.</dd><br />
<dt>Overproduction</dt><dd>Spending time and resources producing more of something than a company needs is a waste. That same time could have been spent doing absolutely nothing or, better, working on something that had direct value to the business. If we built or acquired something physical, then we also get a sneaky secondary waste because now we have to use up valuable space to store that item.</dd><br />
<dt>Unnecessary Motion</dt><dd>Excess walking, stretching, lifting, etc is not only a concern for safety reasons, but also a potential form of waste. As you walk back and forth to the same place 10-15 times a day consider how much time you could save if it was a shorter walk or no walk. Considering the focus many of us are required to bring to our tasks, consider how much smoother they would be if we weren't constantly stepping out of our zone to go walk somewhere and back again.</dd><br />
<dt>Unnecessary Inventory</dt><dd>Excess inventory in the IT world is not just excess equipment, but can also mean excess tasks waiting on their next step. One example would be a backlog of new equipment that is waiting for OS and software installs before it can be usable, another would be a backlog of software tasks that are waiting on QA to validate them. There are costs involved in having unnecessary inventory of anything, physical equipment takes up valuable space and time to inventory and manage, tasks that are sitting around require more extensive tracking and management procedures and start getting in the way of other tasks that are coming in.</dd><br />
<dt>Over Processing</dt><dd>When the tool being used causes more work than should be necessary to complete a job, then we are in the realm of overprocessing. This waste can range from tools being poorly located in relation to one another, using more tool than is necessary for a job, and potentially overuse of the wrong tool simply to justify the expense in purchasing it. When we try to make a tool do a job it isn't good at, we waste time and money with a risk of greater defect rates in our process or end unit.</dd><br />
<dt>Transporting</dt><dd>Excessive movement of a product or task is wasteful of time and risks additional wear, damage, or potential loss of the product or task. Even in development there is waste in transporting a task to QA and back multiple times and understanding why that task is going back and forth, which is why many Agile shops suggest collocation.</dd><br />
<dt>Defects</dt><dd>Making bad or incorrect products is a waste of the time and energy that went into making that product. Completing a task incorrectly or applying the wrong correction in response to a help request is also a waste of time and energy. Any time that we execute the wrong task or produce poorly, we are going to spend more time to determine it was the wrong thing, possibly why it was the wrong thing, and then how we can correct it or start again from the beginning. Doing this occasionally is waste, doing it regularly is an ongoing failure.</dd>
</dl>

<p>Seven wastes. How many of these looked familiar? Would you be surprised if I told you studies had shown that service businesses often ran at the 30-80% waste level? (<a href="http://www.amazon.com/Lean-Six-Sigma-Service-Transactions/dp/0071418210" title="View book at Amazon">Lean Six Sigma For Service, Michael L. George</a>) What if your department was on the best side of that curve and could only manage to reduce waste by half, would a 15% improvement in cost or time be worth it? Reduced times from requests coming in to requests being fulfilled? What if your competitor did it?</p>

<h2>Process Improvement</h2>
<p>There are a lot of process improvement tools out there, as well as a number of methodologies. Lean and Six Sigma, the two I am most familiar with, focus on waste reduction and process quality improvement respectively. Lean has a number of tools for identifying wastes in a process and evaluating them, while Six Sigma brings us tools for measuring the quality of a process and improvements to that quality. Being an expert at neither of these methods, I am instead going to outline some basic methods for evaluating a process and trying solutions.</p>

<h3>Evaluating a Process</h3>
<p>When you are first starting out it will be easier to pick processes that you know are running slowly or that the business is commonly upset with. Later, once you have a bit more experience and a track record to show people, you should involve people that are directly interacting with IT processes and enlist them to help you find wastes in processes. Generally the people actually executing a process have a good idea when it isn't working, however it is important to start evaluating without an end solution in mind. Many times when we can identify problem areas we think we already have a solution, only to find something an order of magnitude better during our improvement process.</p>

<p>Select a process that is commonly considered slow or costly to perform. Starting at the beginning of the process, for instance when the request is generated or when a system triggers a process, draw each step the task goes through on it's way to completion and communications of that completion. At each step write down the average amount of time (you could also choose to write down the maximum, just be consistent). What you should end up with is something like this:</p>

<div style="text-align: center; color: #666666; ">
<img src="http://tiernok.com/LTDBlog/nevertime_workflow.png" alt="Sample Workflow Diagram" /><br />
Diagram #1: Partial sample workflow of PC request process
</div>

<p>In our example workflow it takes almost 20 days from the first request to actually get hardware in so we can start installing software. At each step in the diagram we should be asking ourselves what value is provided by the step and why it takes as long as it does. For example, the most obvious items on the diagram are probably the time for filling out the form and generating the PO. Cutting those two in half would be a 13% improvement in the process time from the request to getting the equipment in. But lets look at a couple more, what value does it provide for the IT Manager to sign off on both the request and the Purchase Order Request? What value does it provide to quote each PC request individually? We now have 4 items to work on improving. </p>

<h3>Improving a Process</h3>
<p>So we have some targets to start improving on from our example above. The simplest tool for reducing the waste of a step in the process is to understand the purpose of the step. By understanding the purpose we can start paring away some of the waste that has attached itself to the process over the course of time. Each step should be evaluated against the goal of the process and determine what part (if any) actually provides some value towards that goal. </p>

<p><em>I like using the 5-Why process to dig into processes, it is simple, direct, and gets good results. A good article can be found <a href="http://lssacademy.com/2010/01/10/introducing-the-5-why-&#8220;so-what&#8221;-test/" title="View the article at LSS Academy">here</a>.</em></p>

<h4>Example 1) The Request Form</h4>
<p>The request form takes 2 days to fill out on average, partially because the end user has to ask a lot of questions about values on the form and partially because it's so long it takes a day to get up the energy to get started. The value it provides is a clear checklist of everything the end user thinks should be on the final PC.<br />
Normally people would look at the situation and ask if we could simplify the form, build a system, or better educate the end users. I would go one step further, can we get rid of the form? What if we created a standard configuration for each department and a standard list of applications for each management position? It still isn't perfect, but would it be closer or farther then having the end user try to create the list for us for each individual PC?</p>

<h4>Example 2) Generating the PO</h4>
<p>The process of generating a PO currently takes 3 days. We identify the value of this process as having the funds to purchase the requested PC. Unfortunately we have over-simplified the process of generating a PO by making it only one step in our diagram and I am sure the person responsible for generating them would have a few words to say about that. Instead of trying to guess, walk down and have a conversation with them. If possible map out the process they are going through, from receiving a request to completion of the PO. If you can get them on board and reduce the process, then you will be making a company wide improvement and I expect to see "Cross-Functional Process Improvement reduced processing of Purchase Orders by 50% company-wide" on your year end list of achievements. For the mean time, lets put this one to the side, as we won't be able to fix it until management sees some good savings from process improvement and we've built up a little credit.</p>

<h4>Example 2b) Generating the PO</h4>
<p>Wait, what? Again?<br />
While we could help the PO process improve, our goal today is to try and improve our example process, so lets look again at what value we are achieving. Earlier we identified the value as being able to purchase the PC. Can we standardize a little? How much of our PC purchases fall into a pattern? We've undoubtedly budgeted for a certain degree of computer equipment throughout the year based on expected labor growth or turnover, would finance allow us to create blanket POs to cover this expense? If we could standardize these PC purchases and use blanket POs, then we have all the value with no cost to this process. A blanket order for new hires and a second for PC replenishment would could cut out 4 Days, approximately 20% of the current process.</p>

<h4>Example 3) IT Manager Sign-off</h4>
<p>Assuming we hadn't simplified the Purchase Order process yet, we had two different instances for the IT Manager to sign-off and in both cases it is taking him/her a day to do so. Before we jump into color-coding labels or special desk trays, lets take a step back and look at why they are signing twice. Is the first signature necessary? What value is it providing? If it is simply an acknowledgment of the request, do they need to do it or can they delegate that to the person processing the request? Potentially 1 day removed (5%). Did we remove the need for the per-order PO? Then that 1 day is definably removed. <br />
And that's one less item to bug your manager about in your weekly meeting. Less stressed managers are happy managers, happy managers are much better than the alternative.</p>

<h4>Example 4) Quoting the PC </h4>
<p>What is the value of quoting the PC? Finding out how much it will cost. Going back to our second example, is there any way we could create some standards? How many PCs models do you need? Most vendors are willing to help you build a standard set of PCs with consistent quotes. Does each individual member of the company need their own special setup, or would a few standard models suffice? If the value of this step is to determine the cost and we can create some standard model configurations, then we just removed the custom quote step and reduced delivery time by another 2 days (or 10%). </p>

<h3>Results</h3>
<p>In our example above we saw the potential for reducing the first half of our new equipment process by almost 50%. These types of numbers are just as achievable in the real world as they are in the example, the difference is going to be that the real world will have more strange extra steps involved and it isn't always possible to completely replace or remove a step. Focus on adding value to the final deliverable and try replacing complex systems with simple ones. Sometimes all it takes to cut a couple days off a process is to have a labeled tray on someones desk or a clear plastic pouch to put documents in on their front door.<br />
As we make improvements we need to communicate them to the wider company. By continuing to pare away at the wastes inherent in your processes, your area (and the company) is going to be running more smoothly and more effectively. </p>

<p>The next step is to grow the process, to be an agent of change in your business. There are others that are or will be interested in continuous improvement, but as you start to widen the scope you need to get buy-in from managers and executives. Having real-world examples of the savings the company has already achieved is going to be a strong argument for taking time away from day-to-day tasks and applying it towards a cultural shift that is an investment in <a href="http://dailykaizen.org/archives/792" title="How do you calculate ROI? You don't!">an unknown ROI</a>.</p>

<h2>Why Improve...</h2>
<p>While it may take more research and thought to identify wastes and start improving your environment, while it may seem easier to simply stand still and keep throwing more technology at problems as they appear, remember that there are companies adopting practices for improvement as part of Agile, Lean, and other cultural shifts. At the worst you will be increasing your effectiveness, decreasing costs, and improving your understanding of the business, at the best you could be starting a company-wide culture shift that requires managers to shift towards leadership and servant-leader roles, requires greater levels of respect for non-managers from the business, and enables businesses to provide high quality results at competitive prices, even when those competitors are offshore at much lower wages.</p>

<p>And the last benefit? Most of us are in our jobs because we like identifying problems and finding solutions for them. Process Improvement is just one more playground that we have available to us, with new and interesting problems that generally benefit from the simplest, most elegant solutions you can come up with. Sure, you're going to have to get up and talk to people. But they will be looking for you at some point anyway, so we might as well save some money, sharpen our skills, and head out to meet them first.</p>

<p>Miss an article in the series?<br />
There Is Never Time For ... <a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-1" title="Read the first article in the series">Part 1: Training and Development</a><br />
There Is Never Time For ... <a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-2" title="Read the second article in the series">Part 2: Standard Processes</a><br />
There Is Never Time For ... <em>Part 3: Process Improvement</em></p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3#comments</comments>
		</item>
				<item>
			<title>There Is Never Time For ... (Part 2)</title>
			<link>http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-2</link>
			<pubDate>Fri, 09 Apr 2010 15:37:24 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="alt">IT Service Management</category>
<category domain="alt">Policy &amp; Standards</category>
<category domain="main">IT Processes</category>			<guid isPermaLink="false">792@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;So we might have some idea on how to improve our skills and knowledge, but it still takes 20 minutes to find a specific switch in the cabinet, the last time a server lost a fan we didn't find out until after it overheated, and we have no idea how many licenses we have purchased. And we'll figure it all out right after I finish this next help desk ticket.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is the second article in a three part series on major gaps that we never seem to have the time to address as well as ideas on how to overcome and initiate processes for closing or reducing those gaps. Each article is based on one high-level subject and provides ideas on how to gain individual and group level traction.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;[Coding|Provisioning|Reporting|...] Standards&lt;/h2&gt;
&lt;p&gt;It's always easy to put off little tasks until later. Labeling new equipment, updating a diagram of a wiring cabinet or server rack, creating monitors for performance and temperatures, testing your backups. Ok, some of these are less than small, and yet we continue to put them off.&lt;br /&gt;
Take a moment and list two or three items you would like to make part of your process for deploying new code, new servers, new databases, new (whatever you do all day long). Ok, now open up your calendar and look forward to the next month, two months, 6 months...where is the reminder that your going to start doing that task, that your going to go back and do it for all the work you have completed to date? Yeah, thought so. This isn't a &quot;one day&quot; task, it's a &quot;Never would have done it&quot; task. Remember, I've been there too. &lt;/p&gt;

&lt;h3&gt;Step 1: Make a Standard&lt;/h3&gt;
&lt;p&gt;The first step is to write it down. Creating a 'standard' is going to be difficult, we naturally shy away from writing these things down because writing is powerful and once it's written down we feel committed. On the other hand, we want it to get done, so that power that makes us nervous is also going to help strengthen our self-discipline and get it done.&lt;br /&gt;
Keep your standard as simple as possible. The more complex your standard is, the harder it will be to actually go out and follow it. if you later find items that need to be added, you can add them, but make do your best to keep it simple and to only add things that are actually practical (both in doing and in result). A simple standard is easier to follow and takes less time, letting you build good habits with less effort.&lt;br /&gt;
&lt;em&gt;For instance, if this is a server deployment standard, list the standard set of software that has to be installed on every server, the standard settings that have to be changed, the services that have to be enabled, an item to ensure it is added to the backup schedule, and one or two of the items you pretended to list earlier when I asked (like monitoring).&lt;/em&gt;&lt;br /&gt;
After building your simple standard you should have a list of X things you already do plus one or two you always thought you should do or, when it broke, wished you had done. Save that document and each time you go to execute the task print off a copy and use it as a checklist. &lt;/p&gt;

&lt;h3&gt;Step 2: Revise your Standard, Review your Process&lt;/h3&gt;
&lt;p&gt;Next add a recurring appointment (once a month or once a quarter) to your calendar to spend 15 minutes reviewing your standard. During this scheduled time you will first assess how well you are following the standard. If there are lines you are skipping then try to root cause the issue and figure out why you are skipping them. If you end up back at &quot;there is never time for..&quot; then go back and review the reasoning for why you wanted to do it in the first place. If a 5 minute task for each server is going to prevent outages and millions in losses, it's going to be a little harder to make a case for not doing it.&lt;br /&gt;
After reviewing how well your doing each line, remove any lines you have determined were wasteful or are no longer necessary and add some additional items to the list. Again, keep your standard in a list format so you can easily use it as a check list to make sure your following your standard process, but also make sure there is enough description that a co-worker would be able to duplicate your process.&lt;/p&gt;

&lt;h3&gt;Step 3: Do It&lt;/h3&gt;
&lt;p&gt;Make it happen. You have a written standard and if you need further help staying on the straight and narrow then here are some more ideas:&lt;/p&gt;
&lt;dl&gt;
   &lt;dt&gt;Tell Your Boss&lt;/dt&gt;&lt;dd&gt;You have a reason you've created this process and your boss probably remembers the last time it cost time, money, or resources to solve a problem that could have been sidestepped. If you can convince them of the importance of your standard then they will also provide some extra [incentive|[pressure|etc] in making sure you follow it.&lt;/dd&gt;&lt;br /&gt;
   &lt;dt&gt;Tell Your Co-Workers&lt;/dt&gt;&lt;dd&gt;They're going to think your crazy, so again you will need to remind them how x minutes of work is going to save the group from that issue that happened in the middle of the night back when. If the group will be sharing responsibility then you not only want to share the standard with them, you probably want to include them in it's inception. You don't have to have everyone in a room together, but you can get them to agree it's a good idea and offer to build s starter standard that can be revised later. Remember, keep it simple so you can build good habits, later on the group can argue for a 50-page list of items.&lt;/dd&gt;&lt;br /&gt;
   &lt;dt&gt;Hold Yourself Responsible&lt;/dt&gt;&lt;dd&gt;Add an [annual|quarterly|whatever] goal to deliver the results of the process. Take the overall issue your trying to resolve (time involved in finding switches during outages, potential costs if a server fan goes out, cost to fix a code defect after it has been deployed, etc) and create a goal that says you will reduce that issue and will do so by implementing and following a standard. A good businessy goal is something your department can report directly up the chain and should be listed on your achievements for year-end review. Worst case, if you find a previously unknown issue that prevents you from reaching the goal, you can still claim success in making savings as well as uncovering a potential dangerous and unknown issue that the department can now work on resolving.&lt;/dd&gt;
&lt;/dl&gt;

&lt;h2&gt;Discipline&lt;/h2&gt;
&lt;p&gt;To many of us it probably sounds crazy to voluntarily create a standard and make more work for ourselves, but it's the greater path of laziness. If we can convince ourselves to have the discipline to identify and execute those little tasks, it will mean fewer 3AM phone calls, fewer stress-filled outages, and fewer year-end inventories audits and other time consuming (and sometimes painful) activities. When you start looking at the number of risks and the amount of unplanned events you can avoid, suddenly the extra 10 or 20 minutes every few weeks, months, or years doesn't seem like so big a deal. But you have to do it, each and every time. Half the job is usually not going to net you half the results, so be disciplined enough to do it every time. If part of a task has to be put off due to an emergency deployment, schedule a meeting reminder to finish it later that day. If your a heavy procrastinator, like me, then remind yourself constantly than it is lazier to do that 5 minute task now then to take a 4AM call. Make it happen.&lt;/p&gt;

&lt;h2&gt;Next - Part 3&lt;/h2&gt;
&lt;p&gt;There is never time to sit and reflect on how your job gets done, experiment to find better ways, or attend non-technical training to improve your team or processes. In fact, if only you could reduce the time you spend on such-and-such task, you might finally have the time to focus on that. Hmm, chicken and egg. &lt;/p&gt;

&lt;p&gt;Miss an article in the series?&lt;br /&gt;
There Is Never Time For ... &lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-1&quot; title=&quot;Read the first article in the series&quot;&gt;Part 1: Training and Development&lt;/a&gt;&lt;br /&gt;
There Is Never Time For ... &lt;em&gt;Part 2: Standard Processes&lt;/em&gt;&lt;br /&gt;
There Is Never Time For ... &lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3&quot;&gt;Part 3: Process Improvement&lt;/a&gt;&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-2&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-2&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-2&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<p>So we might have some idea on how to improve our skills and knowledge, but it still takes 20 minutes to find a specific switch in the cabinet, the last time a server lost a fan we didn't find out until after it overheated, and we have no idea how many licenses we have purchased. And we'll figure it all out right after I finish this next help desk ticket.</p>

<p><em>This is the second article in a three part series on major gaps that we never seem to have the time to address as well as ideas on how to overcome and initiate processes for closing or reducing those gaps. Each article is based on one high-level subject and provides ideas on how to gain individual and group level traction.</em></p>

<h2>[Coding|Provisioning|Reporting|...] Standards</h2>
<p>It's always easy to put off little tasks until later. Labeling new equipment, updating a diagram of a wiring cabinet or server rack, creating monitors for performance and temperatures, testing your backups. Ok, some of these are less than small, and yet we continue to put them off.<br />
Take a moment and list two or three items you would like to make part of your process for deploying new code, new servers, new databases, new (whatever you do all day long). Ok, now open up your calendar and look forward to the next month, two months, 6 months...where is the reminder that your going to start doing that task, that your going to go back and do it for all the work you have completed to date? Yeah, thought so. This isn't a "one day" task, it's a "Never would have done it" task. Remember, I've been there too. </p>

<h3>Step 1: Make a Standard</h3>
<p>The first step is to write it down. Creating a 'standard' is going to be difficult, we naturally shy away from writing these things down because writing is powerful and once it's written down we feel committed. On the other hand, we want it to get done, so that power that makes us nervous is also going to help strengthen our self-discipline and get it done.<br />
Keep your standard as simple as possible. The more complex your standard is, the harder it will be to actually go out and follow it. if you later find items that need to be added, you can add them, but make do your best to keep it simple and to only add things that are actually practical (both in doing and in result). A simple standard is easier to follow and takes less time, letting you build good habits with less effort.<br />
<em>For instance, if this is a server deployment standard, list the standard set of software that has to be installed on every server, the standard settings that have to be changed, the services that have to be enabled, an item to ensure it is added to the backup schedule, and one or two of the items you pretended to list earlier when I asked (like monitoring).</em><br />
After building your simple standard you should have a list of X things you already do plus one or two you always thought you should do or, when it broke, wished you had done. Save that document and each time you go to execute the task print off a copy and use it as a checklist. </p>

<h3>Step 2: Revise your Standard, Review your Process</h3>
<p>Next add a recurring appointment (once a month or once a quarter) to your calendar to spend 15 minutes reviewing your standard. During this scheduled time you will first assess how well you are following the standard. If there are lines you are skipping then try to root cause the issue and figure out why you are skipping them. If you end up back at "there is never time for.." then go back and review the reasoning for why you wanted to do it in the first place. If a 5 minute task for each server is going to prevent outages and millions in losses, it's going to be a little harder to make a case for not doing it.<br />
After reviewing how well your doing each line, remove any lines you have determined were wasteful or are no longer necessary and add some additional items to the list. Again, keep your standard in a list format so you can easily use it as a check list to make sure your following your standard process, but also make sure there is enough description that a co-worker would be able to duplicate your process.</p>

<h3>Step 3: Do It</h3>
<p>Make it happen. You have a written standard and if you need further help staying on the straight and narrow then here are some more ideas:</p>
<dl>
   <dt>Tell Your Boss</dt><dd>You have a reason you've created this process and your boss probably remembers the last time it cost time, money, or resources to solve a problem that could have been sidestepped. If you can convince them of the importance of your standard then they will also provide some extra [incentive|[pressure|etc] in making sure you follow it.</dd><br />
   <dt>Tell Your Co-Workers</dt><dd>They're going to think your crazy, so again you will need to remind them how x minutes of work is going to save the group from that issue that happened in the middle of the night back when. If the group will be sharing responsibility then you not only want to share the standard with them, you probably want to include them in it's inception. You don't have to have everyone in a room together, but you can get them to agree it's a good idea and offer to build s starter standard that can be revised later. Remember, keep it simple so you can build good habits, later on the group can argue for a 50-page list of items.</dd><br />
   <dt>Hold Yourself Responsible</dt><dd>Add an [annual|quarterly|whatever] goal to deliver the results of the process. Take the overall issue your trying to resolve (time involved in finding switches during outages, potential costs if a server fan goes out, cost to fix a code defect after it has been deployed, etc) and create a goal that says you will reduce that issue and will do so by implementing and following a standard. A good businessy goal is something your department can report directly up the chain and should be listed on your achievements for year-end review. Worst case, if you find a previously unknown issue that prevents you from reaching the goal, you can still claim success in making savings as well as uncovering a potential dangerous and unknown issue that the department can now work on resolving.</dd>
</dl>

<h2>Discipline</h2>
<p>To many of us it probably sounds crazy to voluntarily create a standard and make more work for ourselves, but it's the greater path of laziness. If we can convince ourselves to have the discipline to identify and execute those little tasks, it will mean fewer 3AM phone calls, fewer stress-filled outages, and fewer year-end inventories audits and other time consuming (and sometimes painful) activities. When you start looking at the number of risks and the amount of unplanned events you can avoid, suddenly the extra 10 or 20 minutes every few weeks, months, or years doesn't seem like so big a deal. But you have to do it, each and every time. Half the job is usually not going to net you half the results, so be disciplined enough to do it every time. If part of a task has to be put off due to an emergency deployment, schedule a meeting reminder to finish it later that day. If your a heavy procrastinator, like me, then remind yourself constantly than it is lazier to do that 5 minute task now then to take a 4AM call. Make it happen.</p>

<h2>Next - Part 3</h2>
<p>There is never time to sit and reflect on how your job gets done, experiment to find better ways, or attend non-technical training to improve your team or processes. In fact, if only you could reduce the time you spend on such-and-such task, you might finally have the time to focus on that. Hmm, chicken and egg. </p>

<p>Miss an article in the series?<br />
There Is Never Time For ... <a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-1" title="Read the first article in the series">Part 1: Training and Development</a><br />
There Is Never Time For ... <em>Part 2: Standard Processes</em><br />
There Is Never Time For ... <a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ITServiceManagement/there-is-never-time-for-part-3">Part 3: Process Improvement</a></p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-2"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-2&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-2">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-2#comments</comments>
		</item>
			</channel>
</rss>
