Rem =Retrieve the name of the broken DC from the user and verify it’s not this DC.= Outval = outval & vbtab & objContainer.Name & VBCRLF Rem = Get the list of domain controllers=įor Each objContainer in objConfiguration SPath = "LDAP://OU=Domain Controllers," & objRoot.Get("defaultNamingContext") Rem = Get the default naming context of the domain= Rem =This gets the name of the computer that the script is run on =ĬomputerName = sh.RegRead(key & "\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName") NO warranty is expressed or Implied.ĭim objRoot,oDC,sPath,outval,oDCSelect,objConfiguration,objContainer,errval,ODCPath,ckdcPath,myObj,comparename Meanwhile from another server, I ran the script below – worked beautifully. I had a domain controller (DC) which needed to be rebuilt due to serious issues, as it was virtual, I disconnected the network, then simply formatted the OS drive and reinstalled Windows Server from scratch before connecting it back to the network. This script will clean up all metadata left over from a forced removal of a domain controller, e.g. Taken from here, this script is fantastic! You can run this from any domain member computer while logged in as a domain administrator.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |