Search This Blog

Wednesday, April 15, 2009

Configure name, IP and domain membership through the CLI

When installing Windows Server 2008 R2, you do not get the option to configure the computername, IP and domainmembership during setup (When not using a Unattended Setup). So these tasks need to be done ones the installation finishes.
Following commands allow you configure these settings using the command Line Interface.

Rename the computer:

Netdom Renamecomputer %Computername% /Newname:Computername

(Requires a reboot)

Configure the Local area connection

Netsh interface ip set address name="Local Area Connection" Static 192.168.1.1 255.255.255.0 192.168.1.254

Explination: "Netsh interface ip set address name="Local Area Connection" Static Ipaddress Subnetmask Defaultgateway"

Netsh Interface IP Set DNS "Local Area Connection" Static 192.168.1.10

Explination: "Netsh interface ip set DNS "Local Area Connection" Static Ipaddress Dns Server

Configure Domain Membership

Netdom Join %Computername% /Domain:Domainname /UserD:Administrator /PasswordD:*

By Specifying the asterix in the Password (*) the CLI will promt you for a password.

Shutdown -r -t 0

By using the %Computername% variable you do not need to check the computername.

No comments:

Post a Comment