Chapter 2 - Installing and Managing Windows Server 2022
Chapter 2 - Installing and Managing Windows Server 2022
2
Technical requirements
• Many of the decisions that you need to make are licensing-type decisions
• What roles do you intend to install on this server?
• Do they require a special edition?
• Can the more common Server 2022 Standard edition handle it, or do we need the
Datacenter edition for our purposes?
• Is Server Core going to be beneficial from a security perspective, or do we need
the full Desktop Experience?
Technical requirements
Minimum system requirements
• CPU: 1.4 GHz 64-bit that supports: NX, DEP, CMPXCHG16b, LAHF/SAHF,
PrefetchW, and SLAT.
• RAM: 512 MB ECC memory minimum for Server Core, or a recommended 2 GB
minimum for a server running Desktop Experience.
• Disk: 32 GB
• Desktop Experience consumes about 4 GB more space than Server Core
• Requires a PCI Express (PCIe) storage adapter
• ATA/PATA/IDE are not allowed for boot drives
• Windows Server 2022 supports 48 TB of memory and 2,048 logical cores across
64 physical sockets
Installing Windows Server 2022
• Burning that ISO: Download a .ISO file from Microsoft, burn that .ISO to a DVD
or Creating a bootable USB stick
• Running the installer
• plug newly created DVD or
bootable USB into the new
server hardware.
• Boot to it, and the installation
wizard for Windows Server
2022 appear
• After choosing installation
language, the next screen is
Install now
Installing Windows Server 2022
• Select installation
options for Windows
Server 2022
Installing Windows Server 2022
Installing roles and features
• Server Manager launches automatically every time you log in to Windows Server
2022
Installing roles and features
Installing a role using the wizard
• Get-WindowsFeature
Installing roles and features
Installing a feature using PowerShell
• To see only the features that begin with the letters TEL
Installing roles and features
Installing a feature using PowerShell
• To quickly show
only the roles and
features currently
installed on a
server
Installing roles and features
Installing a feature using PowerShell
• To install Telnet-Client
Centralized management and monitoring
• To manage a server => log directly into the server that you need to work on
✓ walking up to the server and logging on with the keyboard and mouse plugged
right into that hardware
✓ Logging into our servers remotely using RDP
• Need some tools that we can utilize to make our management and monitoring, and
even configuration processes, more efficient
Centralized management and monitoring
Server Manager
• Auto-launching program
when logging in to any of
servers
• Help to manage the server
• Give a quick look into
what is currently installed
on the server
Find machines
available within the
network
choose the servers to
manage and move
them over to the
Selected column
Centralized management and monitoring
Server Manager
• Certainly not!
• Need to access our servers directly sometimes
• Many administrators out there will continue using RDP and full desktop-based
access for all management and monitoring of their servers simply because that is
what they are more comfortable with
Centralized management and monitoring
Remote Desktop Connection Manager
• Open up a supported browser from any machine and browse to the WAC URL
• Open up a supported browser from any machine and browse to the WAC URL
• Even though logged into a domain-joined Windows 10 computer, the WAC website
does not automatically try to inject those credentials for its own use but rather
pauses to ask who you are
• WAC interface
Windows Admin Center
Adding more servers to WAC
• You will be presented with choices to add a new server, a new PC, a Windows
Server failover cluster, Azure Stack HCI, or even an Azure VM.
Windows Admin Center
Adding more servers to WAC
• Capabilities to manipulate
servers as well, straight from
this web interface
• Can add roles or features to
servers, create scheduled tasks,
start or stop services, edit the
registry and add Windows
Firewall rules …
• Example: Enable RDP from
inside WAC
Windows Admin Center
Azure integrations
• An easier and faster way to roll out new servers as long as you are building them
all from a relatively similar hardware platform
• Save you quite a bit of time on new server builds
• Sysprep (Microsoft System Preparation Tool): A tool to prepare your system for
duplication
• Allows you to create a master image of your server to reuse as many times as you
want in order to roll out additional servers
• A key benefit to using Sysprep: can put customized settings onto your master
server and install things such as Windows Update prior to Sysprep
Enabling quick server rollouts with Sysprep
• Prepare the master server by getting the Windows Server 2022 OS installed
• Not to install roles onto the master server
• Install OS and make sure device drivers all squared away
• And you’re ready for the next step
Enabling quick server rollouts with Sysprep
Configuring customizations and updates onto your new server
• Configure Customizations:
• start or stop services
• Put things such as files and folders on all of your servers, such as an Admin
Tools folder,..
• Windows Update install: Put any patches on this new server
• Help to save all of that download and installation time for each new server that
you spin up
Enabling quick server rollouts with Sysprep
Running Sysprep to prepare and shut down your master server
• Open up an administrative
Command Prompt and browse to
C:\Windows\System32\Sysprep
• Run sysprep.exe
Enabling quick server rollouts with Sysprep
Running Sysprep to prepare and shut down your master server
Sysprep.exe options:
• /quiet: without status messages on the screen
• /generalize: To remove all of the unique system information (SID) from the
Windows installation (each new server get a new, unique SID).
• /audit: Restarts the machine into a special audit mode for adding additional drivers
• /oobe: Launch the mini-setup wizard when Windows next boots
• /reboot: Restarts when Sysprep finished
• /shutdown: Shuts down the system (not a restart) when Sysprep finished
• /quit: closes Sysprep after it finishes
• /unattend: a special answer file to configure new servers as they come online
Enabling quick server rollouts with Sysprep
Running Sysprep to prepare and shut down your master server
• Make sure NOT boot into Windows again until after you have created master
image or taken master copy of the .VHDX file.
Enabling quick server rollouts with Sysprep
Creating your master image of the drive
• Master server now shut down, and ready to create the master image
• For physical server:
✓ Use any hard disk imaging utility to create an image file from the drive
• For virtual world:
✓ Simply create a copy of the .VHDX file.
✓ Log in to your Hyper-V Server, copy and paste the hard disk file
✓ Renamed the.VHDX filr to help you keep track of the current status of this
image file.
✓ Copy of the .VHDX file somewhere safe
Enabling quick server rollouts with Sysprep
Building new servers using copies of the master image
• For so many years, it was normal that in-place upgrades were almost guaranteed
to tank your server, causing it to be useless in the end
• Due to this, server upgrades almost always meant replacing the server rather than
upgrading it
o Leave the production server running
o Spin up a new one in parallel
o Configure all of the roles and specs needed on that server
o Migration of data and apps to the new server (hopefully, everything up and
working on the new server)
o Then, shut the old server down. This is normal; this is Windows Server
upgrades.
In-place upgrading to Windows Server 2022
• Right-click the Windows PowerShell icon on the Start menu and choose More, Run
as administrator.
• After Windows PowerShell start, you are placed in your home directory on the
system and given a PS prompt, where you can type cmdlets
• If log into system as Administrator, you will receive the following prompt:
PS C:\Users\Administrator>
• Windows PowerShell used to execute most MS-DOS commands, as well as many
UNIX/Linux commands.
• For example, PS C:\Users\Administrator>copy C:\Windows\System32\calc.exe C:\
Using Windows PowerShell
Working with Windows PowerShell
• Support MS-DOS shell features: output redirection (>>) and command chaining (;)
• For example:
PS C:\Users\Administrator>ipconfig >> C:\IPconfig.txt ; cls
save the output to a file called C:\IPconfig.txt, and then clear the screen
• Commands in PowerShell called cmdlets
• Each cmdlet has an action-object or verb-noun structure.
• For example:
o Get-Host: “get” (verb) information about “host” computer (noun).
• Cmdlets are case-insensitive, so Get-Host and get-host are equivalent.
Using Windows PowerShell
Working with Windows PowerShell
• Some key PowerShell cmdlets and commands that administrators often use to
manage Windows Server 2019.
o Restart-Computer
o Stop-Computer
o Rename-Computer newcomputername: to rename a computer
o Add-Computer –DomainName domainname: to join it to an Active Directory.
o Get-WindowsFeature | ogv: display installed and available roles and features
o Install-WindowsFeature: install roles and features
Using Windows PowerShell
System Administration Commands
• For example:
o Install-WindowsFeature –IncludeAllSubfeature –IncludeManagementTools web-
server: Install IIS Web server
o Remove-WindowsFeature web-server: Remove Web server
• Windows PowerShell also used to configure and troubleshoot the network
o Test-NetConnection: Test a connection to identify problems with IP
configuration, firewall configuration, and name resolution.
o Test-NetConnection triosdevelopers.com –Port 443
o Test-NetConnection triosdevelopers.com –Traceroute
Using Windows PowerShell
System Administration Commands
• For example:
o Install-WindowsFeature –IncludeAllSubfeature –IncludeManagementTools web-
server: Install IIS Web server
o Remove-WindowsFeature web-server: Remove Web server
• Windows PowerShell also used to configure and troubleshoot the network
o Test-NetConnection: Test a connection to identify problems with IP
configuration, firewall configuration, and name resolution.
o Test-NetConnection triosdevelopers.com –Port 443
o Test-NetConnection triosdevelopers.com –Traceroute
Using Windows PowerShell
System Administration Commands
• WMI namespaces: represent/organize different types of WMI data in much the same
way that a file cabinet organizes files.
• different namespaces for different purposes, and each namespace holds different
WMI providers
• Only namespace useful to IT administrators within Windows PowerShell is the
CIMv2 namespace (Common Information Model version 2)
o query the hardware and software components on systems
o modify software components as necessary
Using Windows PowerShell
Using WMI within Windows PowerShel
• Instead of specifying the WMI class with Get-WmiObject cmdlet, we can instead
create a WMI query statement and specify it using the –query option.
• WMI query statements use a SQL database language called WQL (WMI Query
Language).
• For example, the following command within Windows PowerShell will select all
attributes/ methods (*) from the win32_share class as shown below:
PS C:\Users\Administrator>gwmi –query "select * from win32_share"
Using Windows PowerShell
Creating PowerShell Scripts
• PowerShell scripts simply text files with a .ps1 extension executed within
PowerShell
• PowerShell scripts can contain both Windows commands and PowerShell cmdlets,
as well as complex control structures.
• The script can be used to accept input that changes how the script works.
• The use of variables and constants, protecting metacharacters, coloring and
formatting output, and the use of decision and loop constructs.
Using Windows PowerShell
Creating PowerShell Scripts: Executing PowerShell Scripts
• To execute a PowerShell script, use a full path or a “forced” relative path (where “.”
refers to the current directory):
o Full path: C:\scripts\myscript.ps1
o Relative path (within the C:\scripts directory): .\myscript.ps1 or ./myscript.ps1
• To execute a PowerShell script outside Windows PowerShell, use the powershell
• For Example:
powershell C:\scripts\myscript.ps1 –noexit
–noexit prevents Windows PowerShell from closing after executing the script)
Using Windows PowerShell
Creating PowerShell Scripts: Using Windows PowerShell ISE
• After adding content to Untitled.ps1, clicking the green Run script (play button)
icon or by pressing the F5 key to execute it
• File -> Save As, and choose to save it with a more descriptive file name to
location of your choice (e.g., C:\scripts\myscript.ps1).
• You can also create and test scripts on remote computers that have winRM started
within Windows PowerShell ISE.
• To do this, navigate to File, New Remote PowerShell Tab and specify the correct
computer name.
• If you are currently logged into an Active Directory domain with domain
administrative privileges, you will be allowed to connect to any computer within
your domain that has winRM started.
Summary