Saturday, April 28, 2012

Fixing broken domain memberships

It is a common problem, a workstation or servers domain membership gets broken. Sometimes because it has been off the network long enough for the system's computer account password to expire, sometimes because you just restored an image and that image had a computer account password that was old. I'm sure there are other reasons too.
Many people fix this issue by taking the system off the domain and then rejoining it. This can be a little painful since:
  • It involves two reboots
  • When you disjoin it you have to place it in a workgroup which will then create unwanted records in your WINS database
  • It can have profile implications
There is a much better way, I have tested this on Windows 2003, Windows 7 & Windows 2008, I'd bet money it works on Vista and Windows 8 also. The solution uses our old friend NETDOM.EXE and the syntax is:

netdom resetpwd /s:<domain controller> /ud:<domain\username> /pd:<password>

Obviously the user specified must have the writes to join a computer to the domain (remember every user is allowed to do that 10 times, after that they willl need to be delegated that permission. Also, this must be run in an admin command prompt on the broken machine. Here is as example:

netdom resetpwd /s:mydomaincontroller /ud:mydomain\mick /pd:myawesomepassword

Notes: You will have to reboot the system once after this to straighten things out and on Vista/Windows 7/Windows 8 you may find that the 'Network and Sharing" center will show 'No Internet connectivity'. If it does then just tell the operating system to run diagnostics and it will burst into life. I have not been able to explain this last nuance.

Cheers!

No comments:

Post a Comment