Reader small image

You're reading from  Mastering Windows Server 2022 - Fourth Edition

Product typeBook
Published inMay 2023
PublisherPackt
ISBN-139781837634507
Edition4th Edition
Right arrow
Author (1)
Jordan Krause
Jordan Krause
author image
Jordan Krause

Jordan Krause has been an IT professional for more than 20 years and has received 9 Microsoft MVP awards for his work with Microsoft server and networking technologies. One of the world's first experts on Microsoft DirectAccess, he has a passion for helping companies find the best ways to enable a remote workforce. Committed to continuous learning, Jordan holds certifications as an MCSE, MCSA, and MCITP Enterprise Administrator, and has authored numerous books on Microsoft technologies. Jordan lives in beautiful West Michigan (USA), but works daily with companies around the world.
Read more about Jordan Krause

Right arrow

PowerShell

If you’ve had some drive-time with Windows 11, you may be wondering to yourself, “Self, why are we reading about PowerShell when it has been replaced by Windows Terminal?” The “replacement” of PowerShell with Windows Terminal inside Windows 11 is generating a little bit of confusion among the user population, but they are not at all the same thing, nor is Terminal an actual replacement for PowerShell. PowerShell is much more than a console screen from which you run commands. It is integrated into all facets of Windows itself. We will discuss Windows Terminal a little bit more at the end of this chapter, and indeed walk through the steps of installing it inside Windows Server 2022 (because it’s not there by default). But for the purposes of PowerShell learning, we can safely leave Terminal out of scope.

So far, we’ve been talking about PowerShell and Terminal, but let’s be honest, many of us are still using Command...

Join our book community on Discord

https://packt.link/SecNet

Honey, I shrunk the server! Another chapter, another outdated movie reference. Over the past 20 years or so, we have seen nothing but growth from Microsoft operating systems. Growth can be good; new features and enhancements make our lives easier. But growth can also be bad, such as bloated file structures and memory-hogging graphical interfaces. If you were to chronologically graph the Windows and Windows Server operating systems in terms of their footprints based on factors such as disk space consumption and memory requirements, it would show a steady upward slope. Every new release seems to require just a little more processing power and just a little more hard drive space than the previous version. I always find it intriguing how many critical pieces of the operating system are still hanging around in locations and folders left over from Server 2003 or even earlier. Even on a brand new Windows Server 2022 instance you...

Why use Server Core?

Why am I even talking about Server Core? Hasn't it been around since 2008? Yes, that is exactly why I am talking about it. The Server Core variant of the Windows Server operating system has been around for quite some time, but it seems like many admins are afraid to use it. I work with many different companies from many different industries. Most of them have one big thing in common: they use a lot of Windows Servers, and all of these Windows Servers are running the full GUI (Desktop Experience). Have they heard of Server Core? Sure. Have they tested it out in a lab? Sometimes. Everyone seems to have a slightly different experience level with Core, but it's quite rare to find one in production. Maybe I'm just talking to the wrong people, but I have to assume that there is a majority of us out there, myself included, who need to start using Server Core on a more regular basis.

Why do we need to start using Server Core? Because GUI-less servers are the...

Interfacing with Server Core

After running through your first installation of Server Core, you will be presented with the following lock screen:

Figure 10.3: Server Core lock screen

Is that really a Command Prompt window that says Press Ctrl-Alt-Del to unlock? Yes, yes it is. This usually gets a few chuckles when an admin sees it for the first time. I know it did for me, anyway. It reminded me a little of when we used to code if/then games on our TI-83 calculators during high school math class. Press Ctrl + Alt + Del, and you will be prompted to change your administrator password for the first time, which is the same task that must always be performed first inside GUI versions of Windows Server. Except, of course, that you do it all from within the Command Prompt window using only your keyboard. After configuring your administrator account password, the login process continues and you’ll even notice some familiar things flip past within this command prompt window such as “...

Windows Admin Center for managing Server Core

While Command Prompt from the console, remote PowerShell connections, remote Server Manager administration, and even the RSAT tools running on a Windows 10 workstation are all valid and powerful tools for administering our Server Core instances, they have all now been upstaged by the release of Windows Admin Center. You have already learned what Windows Admin Center can do for centrally managing your entire server infrastructure, but what we need to point out here is that WAC can be used for servers both with and without graphical interfaces.

I have spoken with many Windows Server administrators about the topic of Server Core, and one of the biggest blocks to implementing these more efficient and secure server platforms is an apprehension that, once configured, ongoing administration and maintenance of these servers will be more difficult to handle. Admins who are familiar and comfortable working within the Windows Server Desktop Experience...

The Sconfig utility

Now we will take a step backward and check out a tool that is available inside Server Core, but one that is generally only useful when working on the console of your server. We mentioned Sconfig earlier in the chapter, but breezed right past it at the time so that you could focus on getting to know Server Core a little bit more intimately from Command Prompt and PowerShell. While you can certainly ignore Sconfig completely and make all configurations and adjustments to your server core from the traditional command interfaces and centralized administration tools, Sconfig is a very nice utility for making initial networking, hostname, and domain membership changes to your new server.

Sconfig has existed for most versions of Server Core, but in the past you always had to intentionally launch it to make use of the capabilities within. Windows Server 2022 is the first time we see it with an auto-launch feature when your server boots. If you have built your own server core...

Roles available in Server Core

Server Core is obviously a restricted form of the operating system, and some of the roles inside Windows Server are just not designed to work properly within that limited context. Fortunately for us, most of them are, which enables Server 2022 administrators to deploy most of their critical infrastructure via the more secure Server Core platform. Here is a list of the roles that are currently supported to run on a Windows Server 2022 Server Core instance, and I marked the ones in bold that I see most often used within the businesses I work with:

  • Active Directory Certificate Services
  • Active Directory Domain Services
  • Active Directory Federation Services
  • Active Directory Lightweight Directory Services
  • Active Directory Rights Management Services
  • Device Health Attestation
  • DHCP Server
  • DNS Server
  • File and Storage Services
  • Host Guardian Service
  • Hyper-V
  • Print and Document Services
  • Remote Access
  • Remote Desktop Services*
  • Volume Activation Services
  • Web Server (IIS...

Building a Server Core domain controller

You are now equipped to spin up Server Core instances, configure them with hostnames, IP addresses, and domain memberships, and administer these new servers using various administrative toolsets. One of the most frequent uses of Server Core that I have seen in production environments is as a secondary domain controller. Let's walk through the process of setting one up so that you have exact steps if ever this situation applies to you.

Begin by prepping the new server. You already know all of this, but here is the basic outline of steps that you want to accomplish before thinking about turning this server into a domain controller:

  1. Spin up the new server and install Server Core.
  2. Use Sconfig or PowerShell from the console to configure a static IP address and a permanent hostname. Remember, once you turn this server into a domain controller, it is not supported to change the name, and not easy to change the IP – so choose wisely. I have...

What happened to Nano Server?

This story about small-footprint Windows Server platforms didn't used to end with Server Core. Anyone who kept tabs on the new features coming out with Server 2016 is aware that there was another installation option for the Server 2016 operating system, called Nano Server. The premise of Nano Server was an even smaller, more secure, more efficient, super-tiny operating system that could run a very limited set of roles. Though limited, it was still capable of being installed on a physical or virtual server platform, run as a true server operating system, and could still host traditional workloads on it.

Unfortunately for Nano Server enthusiasts, and especially for anyone who has already done the work of installing and using it, the story behind Nano Server has flipped around completely over the last few years. To cut a long story short, you can no longer use Nano Server for anything that a traditional server can do. You cannot install it on physical hardware...

Summary

I said it in previous versions of this book, and I’ll say it again now—writing this chapter has been exactly the (re)-kick in the pants that I needed to start thinking about shrinking my own servers. I am in the same boat as many of you: I know what Server Core is and have played around with it, have worked through the exercises in this book numerous times, and I have even supported a handful of them in customer environments to a limited extent. But I have never attempted to change my default mindset when spinning up new servers within production environments that I support. Now that tools such as Sconfig and the new Windows Admin Center are available to us, we have officially run out of excuses as to why we shouldn’t at least consider using Server Core for new instances of Windows Server in our environments. In fact, as I was building out the new DC3-CORE server, I realized just how much faster it is to get a Server Core instance off the ground compared to...

Questions

  1. True or False—Server Core is the default installation option for Windows Server 2022. (Answer: True)
  2. True or False—You can utilize PowerShell to change a Server 2022 from Server Core mode to Desktop Experience mode. (Answer: False, switching back and forth is not possible in Windows Server 2022)
  3. Bonus points: What is the last version of Windows Server which did allow for on-the-fly changing of a server back and forth between Server Core and Desktop Experience? (Answer: Server 2012 R2)
  4. When sitting at the console of a freshly booted Windows Server 2022 Server Core instance, what application do you see on the screen? (Answer: The Sconfig utility)
  5. When sitting at the console of a freshly booted Windows Server 2019 Server Core instance, what application do you see on the screen? (Answer: Command Prompt)
  6. What cmdlet can be used to view the current networking configuration on a Server Core? (Answer: Get-NetIPConfiguration)
  7. Which PowerShell cmdlet can be used to configure...
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Mastering Windows Server 2022 - Fourth Edition
Published in: May 2023Publisher: PacktISBN-13: 9781837634507
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Jordan Krause

Jordan Krause has been an IT professional for more than 20 years and has received 9 Microsoft MVP awards for his work with Microsoft server and networking technologies. One of the world's first experts on Microsoft DirectAccess, he has a passion for helping companies find the best ways to enable a remote workforce. Committed to continuous learning, Jordan holds certifications as an MCSE, MCSA, and MCITP Enterprise Administrator, and has authored numerous books on Microsoft technologies. Jordan lives in beautiful West Michigan (USA), but works daily with companies around the world.
Read more about Jordan Krause