Hi To demote a domain controller through powershell you have to run the following command:
Uninstall-ADDSDomainController
for more information please refer to the following link: https://learn.microsoft.com/en-us/powershell/module/addsdeployment/uninstall-addsdomaincontroller?view=windowsserver2022-ps Please don’t forget to accept helpful answer