In this post we will be upgrade existing Domain controller Windows Server 2016 to Server 2022 which is also known as in-place upgrade. For Windows Server 2022 upgrade, there are few pre-requisites to be met because we need to have latest schema applied on DC and also have to use adprep /forestprep and adprep /domainprep commands.
- Windows Server 2022 Upgrade path
- Download Windows Server
- In-place Upgrade Process
- Verification steps
We need to run Adprep /forestprep once in the forest, while adprep /domainprep needs to be run on each domain where we are trying to upgrade from Server 2016.
Windows Server 2022 release date is 18th Aug, 2021 with Mainstream End date specified as 13th Oct 2026 and Extended End date as 14th Oct 2031.
Windows Server 2022 Upgrade path
Not every Windows server can be upgraded to server 2022 directly. There are specific upgrade paths we need to follow. There is a nice article on Microsoft page which explains it, however it doesn’t show Windows Server 2022 server details as they still need to update it (at the time of writing this blog).
As Windows Server 2022 Schema version is exactly same as Server 2019, I am assuming the path mentioned in the image should work for In-place upgrade from Server 2012 R2 as well (haven’t tested yet). Following are the servers which can be upgraded:
In-place upgrade from Windows Server 2012 R2 to Windows Server 2022
We can upgrade. Server can directly be upgraded from Windows Server 2022. This is only valid for Windows Server 2012 R2 (not for Windows Server 2012). Hence, we can skip version 2016,2019. (Note: I still need to test this behaviour yet). However, we need to upgrade the schema before upgrade.
The steps mentioned in this article, should be applicable for Server 2012 R2 as well.
In-place upgrade from Windows Server 2016 to Windows Server 2022
We can upgrade. Server can directly be upgraded to Windows server 2022, hence we can skip 2019 version. For this version also, we need to upgrade the schema on Windows Server.
In-place upgrade from Windows Server 2019 to Windows Server 2022
We can upgrade. This is one of the easiest upgrade method as we don’t have to upgrade the schema.
Download Windows Server
Once downloaded, either extract the content of ISO locally or mount the ISO.
In-place Upgrade Process
If you try to run in-place upgrade process without running adprep tool you will get following error as shown in the image:
Active Directory on this domain controller does not contain Windows Server 2022 ADPREP /FORESTPREP updates.
Verify Current AD Schema
Run the following PowerShell command (in elevated mode) to verify :
Get-ADObject (Get-ADRootDSE).schemaNamingContext -Property objectVersion
We can see objectVersion is 87, this schema version is associated with “Windows Server 2016”, here is more information on various schema numbers:
|Windows Server 2000||13|
|Windows Server 2003||30|
|Windows Server 2003 R2||31|
|Windows Server 2008||44|
|Windows Server 2008 R2||47|
|Windows Server 2012||56|
|Windows Server 2012 R2||69|
|Windows Server 2016||87|
|Windows Server 2019||88|
|Windows Server 2022||88|
We can see that Schema version 88 is same for both Servers 2019 & 2022. Hence, that’s the reason we don’t need to upgrade the schema in case of in-place upgrade from Windows Server 2019 version.
Open command prompt (elevated rights) on Domain controller and navigate to source directory of Windows Server ISO. In my case the location was d:\support\adprep\adprep.exe.
Run the command adprep.exe /forestprep
Type C and press enter to continue with upgrade of schema. This will upgrade current schema version from 87 to 88.
Schema update in Windows Server 2022 uses Sch88.ldf
This process creates 2 log files under c:\windows\debug\adprep\logs\yyyymmddhhmmss with name ADPrep.log & ldif.log.
ADPrep.log will show you successful upgrade of Schema.
ldif.log will show you attributes which has been extended to schema such as ms-PKI-DPAPIMasterKeys, ms-PKI-RoamingTimeStamp and others.
Run adprep.exe /domainprep to update the domain-wide information.
Let’s begin installation of Server 2022. Launch setup.exe with admin rights.
Under Product key page provide the KMS client setup key. Following are the keys for your reference based upon the version you are using:
Windows Server 2022 Datacenter: WX4NM-KYWYW-QJJR4-XV3QB-6VM33
Windows Server 2022 Standard: VDYBN-27WPP-V4HQT-9VMD4-VMK7H
Click here for KMS Client Setup key provide by Microsoft.
As these are the KMS keys, this needs to be activated later with KMS server within your environment.
On Select Image page, I am going with Windows Server 2022 Datacenter (Desktop Experience) version for full GUI experience, click Next.
Under Applicable notices and license terms page, click Accept.
Under Choose what to keep, this is the page which actually helps us going with the real need of in-place upgrade without loosing files, settings and apps, click Next.
It will first check for available updates, and you might see Getting Updates.
Once ready to install, hit Install button.
The process will first extract the binaries to hidden folder c:\$WINDOWS.~BT.
Once extracted, reboot will happen and server upgrade process will initiate.
This process might take some time depending upon the size of your infra. Once completed, login to the server.
Launch run window (press Windows + R) and type Winver, this will show the Microsoft Windows Server 2022 version 21H2 (OS Build 20348.169).
Where 20348 is the build version and 169 is the patch version which gets updated with every security update.
Open registry (regedit) and navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
You will be able to see lots information, especially ProductName which I am interested in.
Windows Server 2022 can be upgrade from Server 2019, Server 2016 and probably with Server 2012 (yet to test). Important thing to consider is to upgrade the schema from Server 2016 and 2012. Upgrading from Server 2019 doesn’t require Schema upgrade as schema version is 88, which is same for both Server 2019 & Server 2022. Running adprep commands are the crucial steps to perform while planning to upgrade domain controller.