Written by 4:45 pm Microsoft, PowerShell, Virtualization, Windows Server • 4 Comments

Commands for Windows Server Core & Hyper-V Server

Windows Server Core

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

Tags: , , , , , , , , , , , Last modified: August 18, 2018
Close Search Window
Close