Some useful command for Windows Server 2008 and R2 Server core

. A Server Core installation provides a minimal environment for running specific server roles, which reduces the maintenance and management requirements and the attack surface for those server roles. A server running a Server Core installation of Windows Server 2008 supports the following server roles:
  • Active Directory Domain Services (AD DS)
  • Active Directory Lightweight Directory Services (AD LDS)
  • DHCP Server
  • DNS Server
  • File Services
  • Hyper-V
  • Print Services
  • Streaming Media Services
  • Web Server (IIS)
A server running a Server Core installation of Windows Server 2008 R2 supports the following server roles:

  • Active Directory Certificate Services
  • Active Directory Domain Services
  • Active Directory Lightweight Directory Services (AD LDS)
  • DHCP Server
  • DNS Server
  • File Services (including File Server Resource Manager)
  • Hyper-V
  • Print Services
  • Web Server (including a subset of ASP.NET)
To accomplish this, the Server Core installation option installs only the subset of the binary files that are required by the supported server roles. For example, the Explorer shell is not installed as part of a Server Core installation. Instead, the default user interface for a server running a Server Core installation is the command prompt.

Steps for configuring a Server Core installation
The following procedures explain how to configure a computer running a Server Core installation. The steps include:

  • Setting a static IP address
Note: A DHCP address is provided by default. You should perform this procedure only if you need to set a static IP address.

  • Joining a domain
  • Activating the server and entering a product key, if required
  • Configuring the firewall
  • Configuring several aspects with one tool (Windows Server 2008 R2 only)

To set a static IP address

1. At a command prompt, type the following:

netsh interface ipv4 show interfaces

2. Make a note of the number shown in the Idx column of the output for your network adapter. If your computer has more than one network adapter, make a note of the number corresponding to the network adapter for which you wish to set a static IP address.

3. At the command prompt, type:

netsh interface ipv4 set address name=<ID>source=static address=<Static IP> mask=<Subnet Mask> gateway=<Default Gateway>

Where:

ID is the number from step 2 above
Static IP is the static IP address that you are setting
Subnet Mask is the subnet mask for the IP address
Default Gateway is the default gateway

4. At the command prompt, type:

netsh interface ipv4 add dnsserver name=“<ID>” address=<DNS IP>index=1

Where:

ID is the number from step 2 above
DNS IP is the IP address of your DNS server

5. Repeat step 4 for each DNS server that you want to set, incrementing the index= number each time.
Notes: If you set the static IP address on the wrong network adapter, you can change back to using the DHCP address supplied by using the following command:

netsh interface ipv4 set address name=“<ID>” source=dhcp

where ID is the number of the network adapter from Step 2.

To rename the server

1. Determine the current name of the server with the hostname or ipconfig command.

2. At a command prompt, type:

netdom renamecomputer <old Computer Name> /NewName:<New Computer Name>

3. Restart the computer. You can do this by typing the following at a command prompt:

shutdown /r /t 0

To join a domain

1. At a command prompt, type:

netdom join <Computer Name> /domain:<Domain Name> /userd:<UserName> /passwordd:*

Where:

Computer Name is the name of the server that is running the Server Core installation.
Domain Name is the name of the domain to join.
User Name is a domain user account with permission to join the domain.

2. When prompted to enter the password, type the password for the domain user account specified by User Name.

3. If you need to add a domain user account to the local Administrators group, type the following command:

net localgroup administrators /add <Domain Name>\<User Name>

4. Restart the computer. You can do this by typing the following at a command prompt:

shutdown /r /t 0

To activate the server

For Windows Server 2008 R2, enter a product key by typing the following at a command prompt:

slmgr.vbs –ipk<product key>

Then, for both Windows Server 2008 R2 and Windows Server 2008, activate the server by typing the following at a command prompt:

slmgr.vbs -ato

If activation is successful, no message will return in the command prompt.
Notes: You can also activate by phone, using a Key Management Service (KMS) server, or remotely by typing the following command at a command prompt of a computer that is running Windows Vista or Windows Server 2008:

cscript windows\system32\slmgr.vbs <Server Name> <User Name> <password>:-ato

To configure the firewall

Use the netsh advfirewall command to enable remote management from any MMC snap-in, type the following:

netsh advfirewall firewall set rule group=”Remote Administration” new enable=yes

Notes: You can also use the Windows Firewall snap-in from a computer running Windows Vista or Windows Server 2008 to remotely manage the firewall on a server running a Server Core installation. To do this, you must first enable remote management of the firewall by running the following command on the computer running a Server Core installation:

netsh advfirewall set currentprofile settings remotemanagement enable
Advertisements

About David Lim

David has over 15 years of experience in IT industry in designing and implementing Microsoft Solutions ranging from small to enterprise customer. He also has experience in designing and developing Microsoft Unified Communications, Collaboration and Office 365 solutions with focus on Exchange, Lync & SharePoint as well as strategic migration planning in complex business environments. He is specializing in architecture and design of Lync Voice deployments. He has been actively involved in various speaking engagements, the recent being the sessions on Lync On-Premise and Office Interoperability in September 2011 and Office 365 Introduction in November 2011. In recognition of his high-quality real-world technical excellence with the community and with Microsoft, David received the prestigious Microsoft Most Valuable Professional (MVP) Award in April 2011.
This entry was posted in General. Bookmark the permalink.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s