May 11, 2006 at 12:31 pm
I would like to change the service accounts on several SQL servers, and its not practical for me to use Enterprise Manager. Is there a script I can run that will change the accounts and restart the services?
Thanks...Nali
May 11, 2006 at 1:34 pm
Make sure you test this in a test environment!!!
You could attempt this from a batch file using sc commands
something like this
SC [\\SERVERNAME] stop [servicename]
SC config [servicename] obj=[acountname] password=[pswd]
SC [\\SERVERNAME] start [servicename]
Also see KB article http://support.microsoft.com/kb/283811/en-us to verify you have all of the other permissions set etc
May 12, 2006 at 10:28 am
Just be prepared to change any of them back. I changed startup accounts on one particular server and the clients were unable to connect with ODBC unless the connection properties were changed from TCP/IP to Named Pipes (or vice-versa, can't recall which way). Anyway, the client ODBC DSNs were locked down and there were hundreds of them, so the easiest fix was to change back to the original account. I guess you never know what will happen until afterward 🙂
May 12, 2006 at 11:42 am
If you choose this method you may have issues with SP4 application. There are also some registry tweaks that are needed and done when you use EM. Prior to SP4 you could do this without ill affect.
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
May 12, 2006 at 11:45 am
May 12, 2006 at 11:51 am
Thanks for the heads up. I was about to apply the following:
SC stop SQLSERVERAGENT
ping -n 11 127.0.0.1 >NUL
SC \\localdc config SQLSERVERAGENT obj= domain\userid password= cavangar
SC stop MSSQLSERVER
ping -n 11 127.0.0.1 >NUL
SC \\localdc config MSSQLSERVER obj= domain\userid password= cavangar
SC start MSSQLSERVER
SC start SQLSERVERAGENT
I'm running sp3, so maybe I can get away with it....
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply