Join Windows Server 2022 to a Domain KB ID 0001809
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: Join Windows Server 2022 to a Domain
Whilst logged in as a (local) administrative user, click the Windows button > Settings.
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.
Post reboot, log in with domain credentials.
PowerShell: Join Windows Server 2022 to a Domain
Open an Administrative PowerShell window.
Use the following command;
Add-Computer -DomainName pnl.com
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;
PowerShell: Remove Windows Server 2022 from a Domain
Open an Administrative PowerShell window. Use the following commands;
Note: This will place the machine in a workgroup called WORKGROUP.