Server Core Tasks

less than 1 minute read

Description:

When installing Server Core, it is common to do tasks such as these.

To Resolve:

1a. Set IP Address/ Gateway/ DNS:

Get-NetAdapter
New-NetIPAddress -InterfaceIndex 2 -IPAddress 192.168.1.101 -PrefixLength 24 -DefaultGateway 192.168.1.1
Set-DNSClientServerAddress -InterfaceIndex 2 -ServerAddresses @("8.8.8.8", "8.8.4.4")
  1. Enable/Disable Windows Firewall:
Set-NetFirewallProfile -Name Public,Private,Domain -Enabled False
  1. Add/Remove features:
Get-WindowsFeature | Where-Object Installed -eq True
  1. Join to Domain:
Add-computer -DomainName mydomain.com
  1. Activate Windows:
    To see current license: slmgr /dlv
    To activate: Slmgr /ato

  2. Add local users:

net user gerry MyPass! /add
net localgroup administrators gerry /add

# Then, on the actual host, sign out. Hit esc, other sign in options – .\gerry and sign in just to make sure the account is there.

  1. Verify the current Windows Update setting:
    %systemroot%\system32\Cscript scregedit.wsf /AU /v

7a. To enable automatic updates:
Net stop wuauserv
%systemroot%\system32\Cscript scregedit.wsf /AU 4
Net start wuauserv

7b. To disable automatic updates, run:
Net stop wuauserv
%systemroot%\system32\Cscript scregedit.wsf /AU 1
Net start wuauserv