Thursday, July 8, 2010

Basic Commands for Windows Server 2008 R2

Widows Server 2008 R2 comes now with standard as well as core installation options. In core installation you get a traditional blue backgroud and a commnd shell open to you for installation and configurations.
Now about the basic commands,

Configuring IP Address
1- Go to command shell and type

ipconfig/all
(press ENTER)
This command will give you names and brief status of all NICs installed on the server

2- Type this command to determine ID of the NIC you want configured for the usage

netsh interface ipv4 show interfaces
(press ENTER)
Let's suppose 7 is the ID of your desired NIC which we got from this command.
Now we need to give following settings to our NIC
IP Address: 192.168.100.1o
Subnet Mask: 255.255.255.0
Gateway: 192.168.100.254
3- Type this command

netsh interface ipv4 set address 7 source=static address=192.168.100.10 mask=255.255.255.0 gateway=192.168.100.254
(press ENTER)

Now if you again run ipconfig/all you can verify your new setting for IP address.

Configuration of a ServerRole
In order to configure a specific server role we will follow these steps,

1- First of all get a list of features available with Windows Server 2008 R2 in a tabular form by typing this command,

Dism /online /get-features /format:table
(press ENTER)

You will get a list of all features (server roles) that can be installed.

2- Now we pick Hyper-V from the list to install on this server
We have determine that Hyper-V feature is names as "Micorosft-Hyper-V".
We will type this command for installation of Hyper-V feature

Dism /online enable-feature /featurename:Microsoft-Hyper-V
(press ENTER)

Enabling Remote Desktop
You can enable remote desktop on Core server but in order to use it there is a limitation. No two sessions can be utilized at a time either through remote desktop or local console.
If you are logged on locally you will have to log off in order to work through remote desktop session and vice versa.
To enable remote desktop feature for Windows 7 clients use this command


Cscript c:\windows\system32\SERegEDit.wsf /aro
(press ENTER)

To enable remote Desktop feature for Windows XP or 2003 clients use this command

Cscript c:\windows\system32\SERegEdit.wsf /cso
(press ENTER)

Note: Enabling remote desktop for clients running OS older than Vista is not recommended by Microsoft.