Commands for Windows Server Core & Hyper-V Core Server

For some KTSI projects I have been working a lot with Windows Server Core or Hyper-V Server. Now I had to do a lot of automation, so I made this little connection of commands. If you configure the server manually you can do the most important things with the sconfig utility.

Windows Server Core

Networking

Set Hostname

netdom renamecomputer %COMPUTERNAME% /NewName:<NewComputerName> 

Join Domain

netdom join %COMPUTERNAME% /domain:<DomainName> /userd:<UserName> /passwordd:*

Remove Domain

netdom remove

Rename Network Interface

netsh interface set interface name=”old name” newname=”new name”

Configure IP Address

netsh interface ipv4 set address name=”<Interface Name>” source=static address=<IPAddress> mask=<SubnetMask> gateway=<DefaultGateway>

Configure DNS Servers

netsh interface ipv4 add dnsserver name=”<Interface Name>” address=<DNS Server IP> index=1

Disable Firewall (not recommended)

netsh advfirewall set allprofiles state off

 

Remoting

Enable PowerShell Remoting

Enable-PSRemoting

Enable Remotedesktop

netsh advfirewall firewall set rule group=”remote desktop” new enable=yes

Enable Remote Administration

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

Enable Remote Firewall Administration

netsh advfirewall firewall set rule group=”Windows Firewall Remote Management” new enable=yes

Enable ICMP (Ping)

netsh firewall set icmpsetting 8

Enable Remote Disk Management

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

 

Licensing

Enter License key

slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Activate Windows

slmgr.vbs -ato

 

Windows Update

Enable automatic updates

cscript C:'Windows'System32'Scregedit.wsf /au 4

Disable automatic updates

cscript C:'Windows'System32'Scregedit.wsf /au 1

 

Roles & Features

Get availibale features & roles

Dism /online /get-features /format:table

Enable feature & roles

Dism /online /enable-feature /featurename:<featurename>

 

Basics

Change Administrator password

net user administrator *

Restart Computer

shutdown /r /t 0

Logoff

logoff

More information about Server Core: TechNet

Windows Server 8 NIC Teaming

With the Developer Preview release of Windows Server 8 which Microsoft released at BUILD, Microsoft showed the new integrated NIC Teaming feature. Basically you could do NIC Teaming before but you had to use software and driver from network card or server vendors which was sometimes a little bit of a pain.

Now with the integrated NIC Teaming features in Windows Server 8 you can team network cards even if they are from different vendors. I am sure this will make lives of Hyper-V Engineers a lot easier.

Windows Server 8 NIC Teaming

Windows Server 8 NIC Teaming

 

Windows Server 8 NIC Teaming

How to add Disk Cleanup tool in Windows Server 2008 R2

Cleanmgr

Disk Cleanup option on drive’s general properties and  cleanmgr.exe is not present in Windows Server 2008 or Windows Server 2008 R2 by default.So in order to use cleanmgr.exe you’ll need to copy two files that are already present on the server, cleanmgr.exe and cleanmgr.exe.mui.

  1. Copy “C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe” to “%systemroot%\System32″
  2. Copy “C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui” to “%systemroot%\System32\en-US”

Now you can launch the Disk cleanup tool (cleanmgr.exe) from the command prompt.

You could also install the “Desktop Experience” feature this would also work, but why install something if you don’t need it, specially on a server.

More on this on TechNet

 

WHS with HP ProLiant MicroServer N40L

HP ProLiant MicroServer N40L

Two days ago my HP ProLiant MicroServer N40L arrived. Since I need more disk space I was looking for a good NAS solution. My first experiences with some of the common NAS vendors were not that great, most of the time the NAS was very very slow. Now this may has changed in the past years but still I prefer a mini server with a Windows OS.

That is where the HP ProLiant MicroServer and Windows Home Server 2011 meet, so I gave it a try. And guess what, it’s a great solution and it does exactly what I need. It stores files with a good performance, it’s quiet, it does not need a lot of power, let me stream content to my Xbox and enables me remote access to my data.

HP ProLiant MicroServer N40L

  • HP ProLiant MicroServer N40L
  • AMD Turion II NEO N40L 1.5GHz, 15W
  • 4GB ECC DDR3 SDRAM
  • 2x 2TB WD Caviar Green WD20EARX 5400 rpm, 64 MB Cache, 8,9 ms, SATA3
  • Windows Home Server 2011

Now at the moment I use these two WD 2TB Disks in a RAID 1, and the N40L still offers space for two other drives.

Install SNMP on Hyper-V R2 Core Server

Hyper-V

If your running Microsoft Hyper-V R2 or any Windows Server 2008 R2 Core Server you can install the SNMP Feature on the command line with the command line tool dism.

First you can list all Windows Features

Dism /online /get-features /format:table  

Now you can install for the SNMP Service:

Dism /online /enable-feature /featurename:SNMP-SC

SNMP Feature Core Server

After you have done this you and you have enabled Remote Management you can mange and configure smtp via remote MMC.

SNMP Service

Important: If you need to configure the SNMP Service on a remote machine you have to install the SNMP feature on the local administrative computer. Otherwise you will not see the SNMP specific tabs.

SNMP Service

More Information on installing Windows Features on a server running a Server Core installation of Windows Server 2008 R2: http://technet.microsoft.com/en-us/library/ee441253(WS.10).aspx

Windows Server 8 Hyper-V VHDX improvements

VHDX

With Windows 8 and Windows Server 8 Microsoft released a new file format for Virtual Hard Disk called VHDX.

The VHD format, which was availible since 2005 (Microsoft Virtual PC) and is now used by Microsoft Hyper-V and other Hypervisor, had some limitations.

The latest version of the VHD format was limited to 2TB of size and a block file size of 512bytes.

Now with VHDX Microsoft kills this limitations and brings some other improvements:

  • Supports up to 16TB size
  • Supports larger block file size
  • improved performance
  • improved corruption resistance

At this time you can use the VHDX format only with Windows 8 and Windows Server 8. But you can convert VHDs the VHDX format and VHDX disks back to VHDs.

Windows Server 8 Hyper-V VHDX