Got an hour to burn? – Add Server Core R2 to a domain and Install IIS 7

I’m on my way to the 2009 MVP summit, I had a two hour layover in Detroit.   Considering I forgot to bring a book to read, I thought I would geek a little.  Within 40 minutes, I had a Server Core box configured with IIS, added to my domain and managing it remotely.   Pretty darn cool I must say’  I pulled the commands from a few posts including a post by Ruslan how to install IIS on a Server Core on R2.  On my laptop, I have VM Workstation and a small network.  I installed a loopback adapter and all VM’s use this as their network adapter.   My first VM I installed w2k8 r2 full version, then installed an additional network adapter inside VMWare workstation.  I installed RRAS and promoted to a domain controller.  This allows any additional VM’s to route the traffic outbound.  I’ve done the same thing with Virtual PC 2007, this time around I gave vmware workstation a try.  Both seem to be about the same. 🙂


Here are the commands I used along with the links.



Setup your network
netsh interface ipv4 set address name=”Local Area Connection” source=static address=192.168.167.20 mask=255.255.255.0 gateway=192.168.167.2


Set a DNS Server
netsh interface ipv4 add dnsserver name=”Local Area Connection” address=192.168.167.2


Change machine name


hostname


netdom renamecomputer oldBoxname /NewName:NewBoxName


Join the computer to domain
//* means you’ll be prompted for the password
//netdom join /? will show all commands
netdom join Newcomputername /domain:SteveSchofield.local /Userd:administrator /passwordd:*


//To perform basic and default installation of IIS on Server Core run the following command:
//Working with ocsetup seems to be case sensative, so be aware. 🙂
start /w ocsetup IIS-WebServerRole


//Installing ASP.NET
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


Installing PowerShell and IIS snap-in
start /w ocsetup MicrosoftWindowsPowerShell
windowssystem32WindowsPowerShellv1.0powershell.exe


After running this command you should see a PowerShell prompt. Type the following to import IIS snapin:
import-module WebAdministration


After that you can get the list of available IIS cmdlets by typing
get-command –pssnapin WebAdministration


//Logout of Powershell command shell othewise the commands below failed. 
//I didn’t figure out the syntax to do the Management service install inside Powershell
Type exit


Install and enabling IIS Remote Management


start /w ocsetup IIS-ManagementService
reg add HKEY_LOCAL_MACHINESOFTWAREMicrosoftWebManagementServer /v EnableRemoteManagement /t REG_DWORD /d 1


//Start Management Service.
net start wmsvc


//Go to another machine and manage IIS
//Article how to use IIS manager to connect remotely

http://learn.iis.net/page.aspx/158/remote-administration-for-iis-manager/

//Browse to ensure IIS is working
Create a test asp.net page on the Server Core box


//Inside Server Core, type Notepad
Add


<html>
 <body>
  <h1>Hello world from Server Core R2</h1>
 </body>
</html>


This is darn cool!  Running ASP.NET on Server Core R2 and managing the Website remotely


Steve Schofield
Microsoft MVP

4 thoughts on “Got an hour to burn? – Add Server Core R2 to a domain and Install IIS 7”

  1. Hi Steve

    Thanks for the commands in text on this blogpost. Would you care to make a screencast of how you did this? I would appreciate hearing some of the commentary along the way. My big interest is about the installation of IIS and ASP.NET, and deploying an ASP.NET application (the virtualization routing less of an interest).

    Like

  2. When I run: import-module WebAdministration, I get:

    The term ‘import-module’ is not recognized as a cmdlet, function, operable prog
    ram, or script file. Verify the term and try again.
    At line:1 char:14
    + import-module <<<< WebAdministration

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s