jeff.sadowski Posted October 13, 2008 Share Posted October 13, 2008 I did some slight modifications to the instructions I found hereI build a script to do it for me. I built my own cd with chntpw and my script and the srvany.exe to reset a domain's Administrative passwordrem This script was writen by Jeff Sadowski following instructions fromrem http://www.nobodix.org/seb/win2003_adminpass.htmlrem I did a few things differently but its basically the same procedurerem create a directory to put the toolsset passrec=c:\passrecmkdir %passrec%copy srvany.exe %passrec%rem install srvany as a service called PassRecovery sc create PassRecovery binPath= "%passrec%\srvany.exe" start= auto type= interact type= ownrem start creating a registry file to add the necessary arguments to srvany echo REGEDIT4 > %passrec%\passrec.regecho [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\PassRecovery\Parameters] >> %passrec%\passrec.regREM replace single \'s with two so the regedit will put them inecho "Application"="%WINDIR:\=\\%\\System32\\cmd.exe" >> %passrec%\passrec.regrem create vbscript to complete the registry file with a password that gets typed inecho password=InputBox("password:") > %passrec%\password.vbsecho Set objShell = WScript.CreateObject("WScript.Shell") >> %passrec%\password.vbsecho double_greater=">>" >> %passrec%\password.vbsecho command="cmd /C echo ""AppParameters""=""/k net user administrator " ^& password ^& " /domain"" " ^& double_greater ^& " %passrec%\passrec.reg" >> %passrec%\password.vbsecho objShell.Run command, 1, True >> %passrec%\password.vbswscript %passrec%\password.vbsrem use the registry file to add the entriesregedit /s %passrec%\passrec.regdel %passrec%\password.vbsdel %passrec%\passrec.regrem create a removal script to run after the server is back upecho net stop PassRecovery > %passrec%\uninstall.batecho sc delete PassRecovery >> %passrec%\uninstall.batecho pause >> %passrec%\uninstall.batpause Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now