<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RuslanY Blog &#187; PowerShell</title>
	<atom:link href="http://ruslany.net/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://ruslany.net</link>
	<description>IIS, FastCGI, PHP and other interesting stuff</description>
	<lastBuildDate>Fri, 30 Jul 2010 23:07:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Setup IIS on Server Core – Windows Server 2008 R2</title>
		<link>http://ruslany.net/2009/02/setup-iis-on-server-core-windows-server-2008-r2/</link>
		<comments>http://ruslany.net/2009/02/setup-iis-on-server-core-windows-server-2008-r2/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 01:20:24 +0000</pubDate>
		<dc:creator>ruslany</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[ASPNET]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://ruslany.net/?p=260</guid>
		<description><![CDATA[This post has been updated from its original version to correct the installation instructions, which have changed since the time the post was written in Feb 2009. With the addition of .NET Framework to Server Core in Windows Server 2008 R2 the Server Core installation option became even more appealing for those who want to use [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>This post has been updated from its original version to correct the installation instructions, which have changed since the time the post was written in Feb 2009.</p></blockquote>
<p>With the addition of .NET Framework to Server Core in Windows Server 2008 R2 the Server Core installation option became even more appealing for those who want to use a very low footprint server for hosting their applications. Availability of .NET framework provides the following great benefits:</p>
<ol>
<li><strong>ASP.NET support</strong> – you can now use Server Core to host your ASP.NET applications.</li>
<li><strong>IIS Remote Management</strong> – Server Core does not provide any user interface other than command line. But if you prefer to use IIS Manager UI to administer IIS, you can now use IIS Remote Manager to connect to IIS on Server Core and perform all the management tasks from within familiar UI of IIS Manager.</li>
<li><strong>PowerShell</strong> – Windows Server 2008 R2 includes IIS PowerShell snapin, which is also available on Server Core.</li>
</ol>
<p>This post describes how to setup and configure IIS on Server Core in Windows Server 2008 R2. Specifically the following tasks are described:</p>
<ul>
<li>Using oclist and ocsetup commands</li>
<li>Basic Installation of IIS</li>
<li>Installing ASP.NET</li>
<li>Installing PowerShell and IIS snap-in</li>
<li>Enabling IIS Remote Management</li>
</ul>
<p><span id="more-260"></span></p>
<h3>Using oclist and ocsetup commands</h3>
<p><strong>oclist</strong> command can be used to list the available and installed roles and services on the server. The output of the command looks similar to below:</p>
<p><a href="http://ruslany.net/wp-content/uploads/2009/02/oclist.png"><img class="alignnone size-medium wp-image-261" style="border: 0px;" title="oclist" src="http://ruslany.net/wp-content/uploads/2009/02/oclist-500x245.png" alt="oclist command output" width="500" height="245" /></a></p>
<p>It is important to understand how <strong>oclist</strong> renders component dependencies. For example, in the above screenshot the oclist output shows that IIS-FTPExtensibility is dependent on IIS-FTPSvc, so in order to install IIS-FTPExtensibility it is first necessary to install IIS-FTPSvc.</p>
<p><strong>ocsetup</strong> command can be used to install and uninstall individual roles and services.</p>
<h3>Basic Installation of IIS</h3>
<p>To perform basic and default installation of IIS on Server Core run the following command:</p>
<pre name="code" class="dos">
start /w ocsetup IIS-WebServerRole
</pre>
<p>After the command has run you can run <strong>oclist | more</strong> and check which IIS components have been installed.</p>
<h3>Installing .NET Framework</h3>
<p>If you plan to use ASP.NET or IIS Remote Management then it is necessary to install .NET Framework first. To install it use the following commands:</p>
<pre name="code" class="dos">
start /w ocsetup NetFx2-ServerCore
start /w ocsetup NetFx2-ServerCore-WOW64
</pre>
<h3>Installing ASP.NET</h3>
<p>To install ASP.NET on Server Core run the following commands in exact same order as listed below:</p>
<pre name="code" class="dos">
start /w ocsetup WAS-NetFxEnvironment
start /w ocsetup IIS-ISAPIExtensions
start /w ocsetup IIS-ISAPIFilter
start /w ocsetup IIS-NetFxExtensibility
start /w ocsetup IIS-ASPNET
</pre>
<h3>Installing PowerShell and IIS snap-in</h3>
<p>First, install the PowerShell by running the command as below:</p>
<pre name="code" class="dos">
start /w ocsetup MicrosoftWindowsPowerShell
</pre>
<p>Next, launch the PowerShell by running this command:</p>
<pre name="code" class="dos">
\windows\system32\WindowsPowerShell\v1.0\powershell.exe
</pre>
<p>After running this command you should see a PowerShell prompt.</p>
<p>In order to enable the IIS snapin it is necessary to change the script execution policy by running this command:</p>
<pre name="code" class="dos">
Set-ExecutionPolicy RemoteSigned
</pre>
<p><strong>Restart PowerShell</strong> for the policy changes to take effect. After re-entering the PowerShell import the IIS snapin:</p>
<pre name="code" class="dos">
import-module WebAdministration
</pre>
<p>After that you can get the list of available IIS cmdlets by typing</p>
<pre name="code" class="dos">
get-command –module WebAdministration
</pre>
<p>Refer to the article <a title="Managing IIS with IIS 7.0 PowerShell Snap-in" href="http://learn.iis.net/page.aspx/447/managing-iis-with-the-iis-70-powershell-snap-in/">Managing IIS with IIS 7.0 PowerShell Snap-in</a> for more information.</p>
<h3>Enabling IIS Remote Management</h3>
<p>In order to install IIS remote management service it is necessary to install .NET Framework first. Refer to the <strong>Installing .NET Framework</strong> section above for more details.</p>
<p>Install the IIS management service by executing this command:</p>
<pre name="code" class="dos">
start /w ocsetup IIS-ManagementService
</pre>
<p>Then enable remote management by running this command:</p>
<pre name="code" class="dos">
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WebManagement\Server ^
/v EnableRemoteManagement /t REG_DWORD /d 1
</pre>
<p>And finally start the management service:</p>
<pre name="code" class="dos">
net start wmsvc
</pre>
<p>Now you can connect to the IIS on the Server Core from a remote machine by using <a title="IIS Remote Manager" href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;g=6&amp;i=1626" target="_blank">IIS Remote Manager</a>.</p>
<p><em><strong>Acknowledgement</strong>: thanks to Saad Ladki and <a title="Thomas Deml blog" href="http://blogs.iis.net/thomad/">Thomas Deml </a>from IIS team for explaining to me all these steps.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://ruslany.net/2009/02/setup-iis-on-server-core-windows-server-2008-r2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
