<meta property="og:description" content="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. Networking Set Hostname netdom renamecomputer %COMPUTERNAME% /NewName: Join Domain netdom join %COMPUTERNAME% /domain: /userd: /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=”” source=static address= mask= gateway= Configure DNS Servers netsh interface"> <meta name="twitter:description" content="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. Networking Set Hostname netdom renamecomputer %COMPUTERNAME% /NewName: Join Domain netdom join %COMPUTERNAME% /domain: /userd: /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=”” source=static address= mask= gateway= Configure DNS Servers netsh interface"> Commands for Windows Server Core & Hyper-V Server - Thomas Maurer

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:&lt;NewComputerName&gt;

Join Domain

netdom join %COMPUTERNAME% /domain:&lt;DomainName&gt; /userd:&lt;UserName&gt; /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=&lt;Interface Name&gt;” source=static address=&lt;IPAddress&gt; mask=&lt;SubnetMask&gt; gateway=&lt;DefaultGateway&gt;

Configure DNS Servers

netsh interface ipv4 add dnsserver name=&lt;Interface Name&gt;” address=&lt;DNS Server IP&gt; 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:&lt;featurename&gt;

 

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