Jump to content
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Rss Bot

SysAdmin Telegram Channel: https://sid-500.com/2017/07/11/setting-up-windows-server-core-with-powershell/ …

Recommended Posts

This is not your father´s Windows Server: Setting up Server Core with PowerShell

 

This guide describes the basic configuration of Windows Server Core running Windows Server 2012 and Windows Server 2016.

 

The following configuration steps will work not only on Server Core, but also on a Windows Server with graphical interface. If you want to keep it simple, you can use sconfig to configure your Server Core: Windows Server 2016: sconfig. But in this article we configure Core with PowerShell.

First, install Server Core and login with administrative privileges.

Configuring Network Settings

The entire configuration is performed in PowerShell, so PowerShell must be started after login.

1

Afterwards, we have to find out the ID of the network adapter.

Get-NetAdapter

Now the IPv4 address and the default gateway can be configured with New-NetIPAddress.

New-NetIPAddress -IPAdress 192.168.112.254 -PrefixLength 24 -DefaultGateway 192.168.112.1 -InterfaceIndex 12 -AddressFamily IPv4

1.jpg

Check the settings with Get-NetIPConfiguration.

Get-NetIPConfiguration

4

Next configure the DNS-Server with Set-DnsClientServerAddress.

Set-DnsClientServerAddress -InterfaceIndex 12 -ServerAddresses 10.10.10.5,10.10.10.10

1

And check the DNS thing.

Get-DnsClientServerAddress -InterfaceIndex 12

1.jpg

Finally, test the IP Configuration with Test-Connection.

Unbenannt.PNG

Computername

Use Rename-Computer to change the computername.

Rename-Computer server02

Next restart the computer by using Restart-Computer.

Restart-Computer

After restarting, start PowerShell again and quickly check the hostname with

$env:computername

1.jpg

Windows Server Activation

Run slmgr to activate your Windows Server. If you are using the Evaluation Version of Windows there is no need for activating.

slmgr -ato

1.jpg

Windows Updates

Automatic updates can be configured with cscript. Navigate to windows\system32 and run cscript to configure the automatic download and installation of Windows Updates.

Configure
cscript scregedit.wsf /AU 4

Check
cscript scregedit.wsf /AU /v

1.jpg

Printer

To install printers, the role Print-Services must be installed.

Install-WindowsFeature Print-Services

Then run printui.exe / il and select the printer.

printui.exe /il 

1.jpg

Now just open Notepad, create a new file and try to print.

Get-Content C:\test.txt | Out-Printer

Drivers

For installing drivers use pnputil.

Some examples:

Unbenannt.PNG

What’s next?

Server Core supports the promotion to a Domain Controller as described in my article: PowerShell: How to install a Domain Controller with Server Core

For configuring Roaming Profiles with PowerShell go for my article Active Directory: Configuring Roaming Profiles using GUI or PowerShell.

Hope you like it!

https://sid-500.com/2017/07/11/setting-up-windows-server-core-with-powershell/

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×