Extend evaluation period of windows server

Windows 2019

To extend the evaluation period the following steps can be used:
Open an elevated command prompt (cmd)
Enter the following command:
cscript.exe %windir%\system32\slmgr.vbs /dlv

The Windows Server evaluation version can be used for 3 years.
To rearm use the following command:
cscript.exe %windir%\system32\slmgr.vbs /rearm

Windows 2022

Check:

slmgr -dlv

Rearm:

slmgr -rearm
Restart-Computer