<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tech-Blog: Tag windows</title>
    <link>/articles/tag/windows</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Mike Pierson's technology blog</description>
    <item>
      <title>On Bootstrapping Active Directory for EC2's Windows Images</title>
      <description>&lt;p&gt;Amazon's EC2 service now includes a number of &lt;a href='http://aws.amazon.com/windows/'&gt;Windows Server 2003 images&lt;/a&gt;, starting at $0.125 per hour.  These Microsoft sanctioned images are a great alternative to the &lt;a href='http://www.howtoforge.com/amazon_elastic_compute_cloud_qemu'&gt;QEMU shenanigans&lt;/a&gt; from the past.&lt;/p&gt;

&lt;p&gt;One of the advantages of Amazon's EC2 service is the ability to provision virtual machines via scripts, and without human interaction.  Here's a description of my approach to bringing an instance of Active Directory online via script.&lt;/p&gt;

&lt;p&gt;Prerequisites:&lt;/p&gt;
&lt;ul&gt;
 &lt;li&gt;Amazon EC2 account
 &lt;li&gt;command line RDP client (e.g. rdesktop)
 &lt;li&gt;dcpromo answer file (I found Daniel Petri's &lt;a href='http://www.petri.co.il/unattended_installation_of_active_directory.htm'&gt;article&lt;/a&gt; helpful)
&lt;/ul&gt;

&lt;p&gt;Your RDP client will need to support two features: file sharing, and remote script execution.  I've found the Mac RDP clients tough to use via script, but Ubuntu's &lt;i&gt;rdesktop&lt;/i&gt; works just fine in a VirtualBox VM.&lt;/p&gt;

&lt;h3&gt;Starting the Windows Server VM&lt;/h3&gt;
&lt;p&gt;Choose the &lt;a href='http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1792&amp;categoryID=209'&gt;Basic Microsoft Windows Server 2003&lt;/a&gt; image or the &lt;a href='http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1793&amp;categoryID=209'&gt;Basic Microsoft Windows Server 2003 with Authentication Services&lt;/a&gt; image; a small standard instance type should be sufficient.&lt;/p&gt;
&lt;p&gt;(The Firefox &lt;a href='http://sourceforge.net/projects/elasticfox/'&gt;elasticfox&lt;/a&gt; EC2 plugin makes it easy to manage windows instances.)&lt;/p&gt;

&lt;p&gt;Once your instance is online, you'll need the public DNS name and administrator password for the instance.&lt;/p&gt;

&lt;h3&gt;Installing Active Directory&lt;/h3&gt;

&lt;p&gt;Normally, AD is installed and configured by running &lt;i&gt;dcpromo&lt;/i&gt; and working through the  relevant dialog boxes.  Unattended installs are supported via the &lt;i&gt;/answer&lt;/i&gt; argument:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
   C:&gt; dcpromo /answer:%path_to_answer_file%
 &lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Running this command on an EC2 instance poses two challenges: how to run a windows command remotely from a script, and how to copy our &lt;i&gt;dcpromo&lt;/i&gt; answer file from our local host to EC2.   Fortunately RDP solves both problems.  Using rdesktop one can define a script to run on session startup, and a local folder to share with the remote host.&lt;/p&gt;
&lt;p&gt;Install Active Directory remotely using &lt;i&gt;rdesktop&lt;/i&gt; as follows:&lt;/p&gt;
 
&lt;p&gt;
 &lt;pre&gt;
   mpierson:$ rdesktop -r disk:share=/home/mpierson/winshare/ \
     -u Administrator -p &amp;lt;admin_password&amp;gt; \
     -s "dcpromo /answer:\\\\tsclient\\share\\dcpromo.install" \
     &amp;lt;windows_hostname&amp;gt;
 &lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;where &lt;i&gt;/home/mpierson/winshare/dcpromo.install&lt;/i&gt; is the local path of the &lt;i&gt;dcpromo&lt;/i&gt; answer file for your AD configuration.   (The RDP file share defined by the &lt;i&gt;-r&lt;/i&gt; argument will appear in the Windows host network share list with a host name of &lt;i&gt;tsclient&lt;/i&gt;.)&lt;/p&gt; 

&lt;p&gt;FWIW, here is an &lt;a href='http://qdvt1jwcv8mbupt2.tech-blog.s3.amazonaws.com/dcpromo.install'&gt;example&lt;/a&gt; answer file for &lt;i&gt;dcpromo&lt;/i&gt;.&lt;/p&gt;

&lt;h3&gt;Access Your AD Domain&lt;/h3&gt;

&lt;p&gt;Use &lt;i&gt;rdesktop&lt;/i&gt; to access your new AD domain as follows:&lt;/p&gt;
&lt;p&gt;
 &lt;pre&gt;
   mpierson:$ rdesktop 
     -u Administrator -p &amp;lt;admin_password&amp;gt; \
     -d &amp;lt;win_domain_name&amp;gt; \
     &amp;lt;windows_hostname&amp;gt;
 &lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;where &lt;i&gt;win_domain_name&lt;/i&gt; is the DomainNetBiosName defined in your &lt;i&gt;dcpromo&lt;/i&gt; answer file.&lt;/p&gt;


</description>
      <pubDate>Wed, 29 Apr 2009 09:09:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:c8b4eed4-c5e4-4d6a-a2f9-19898c874a0e</guid>
      <author>Mike</author>
      <link>/articles/2009/04/29/on-bootstrapping-active-directory-on-ec2s-windows-server-2003-image</link>
      <category>technology</category>
      <category>ec2</category>
      <category>windows</category>
      <category>activedirectory</category>
      <trackback:ping>/articles/trackback/464</trackback:ping>
    </item>
    <item>
      <title>links for 2007-02-28</title>
      <description>&lt;ul class="delicious"&gt;
	&lt;li&gt;
		&lt;div class="delicious-link"&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/directory/activedirectory/stepbystep/domcntrl.mspx"&gt;Installing Win2k3&lt;/a&gt;&lt;/div&gt;
		&lt;div class="delicious-tags"&gt;(tags: &lt;a href="http://del.icio.us/mpierson/windows"&gt;windows&lt;/a&gt; &lt;a href="http://del.icio.us/mpierson/activedirectory"&gt;activedirectory&lt;/a&gt; &lt;a href="http://del.icio.us/mpierson/howto"&gt;howto&lt;/a&gt;)&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;


</description>
      <pubDate>Tue, 27 Feb 2007 19:20:03 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:60531402-efb9-4b97-8abb-d52d57b67830</guid>
      <author>Mike</author>
      <link>/articles/2007/02/27/links-for-2007-02-28</link>
      <category>delicious</category>
      <category>windows</category>
      <category>activedirectory</category>
      <category>howto</category>
      <trackback:ping>/articles/trackback/339</trackback:ping>
    </item>
  </channel>
</rss>

