Server 2022 Domain Join KB ID 0001809
Problem
To join Windows Server 2022 to a Domain (Local Domain). The end proces is the same as it’s always been, they’ve just made the job of getting to there a little more convoluted, (this is the same with Windows 11).
Solution: Server 2022 Domain Join
Whilst logged in as a (local) administrative user, click the Windows button > Settings.
System.
About.
Advanced system settings.
Computer name > Change.
Select the domain radio button > Type in the domain name (must be resolvable in DNS, if in doubt try ‘pinging‘ the domain name” > OK > Enter a domain credential that has right to add machines to a domain. (Here I’m using the domain admin account, but normally a domain user can add a number (10 by default) of machines to a domain) > OK.
BUG / BAD UI ALERT: Minimise the window (because the popup box you are waiting for will appear behind it (please fix this Microsoft!)) > OK.
OK > OK.
Close.
Restart Now.
Post reboot, log in with domain credentials.
PowerShell: Server 2022 Domain Join
Open an Administrative PowerShell window.
Use the following command;
[box]
Add-Computer -DomainName pnl.com
[/box]
Enter a domain credential that has right to add machines to a domain. (Here I’m using the domain admin, but normally a user can add a number (10 by default) of machines to a domain) > OK.
After a few seconds, it should tell you to reboot, you can do so by entering;
[box]
Restart-Computer
[/box]
PowerShell: Remove Windows Server 2022 from a Domain
Open an Administrative PowerShell window. Use the following commands;
[box]
Remove-Computer Restart-Computer
[/box]
Note: This will place the machine in a workgroup called WORKGROUP.