SQL Server 2008 RTM - Change login & password for an SQL Server service account.
-
28 марта 2012 г. 16:56
Hello All !
I have a SQL Server account service which runs under "Authority NT\Network Service". For security reasons, I need to change it in order to run it under an AD account. I want to automate this change after SQL Server installation (made by unattended configuration file).
Installation runs ok. How can I proceed to do that ? With SMO and Powershell ? or else ?
Thanks for advance for your ideas / help - Regards - Have a nice day ! RHUM2
Все ответы
-
28 марта 2012 г. 20:46Модератор
Hello,
SMO or Powershell ? I think that it is quite the same thing ( as usually Powershell is using calls to SMO/WMI to this change )
You wrote" I have a SQL Server account service which runs under "Authority NT\Network Service". " I suppose that you want to change the account under which this SQL Server service is running.
You will have a look at
http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.wmi.service(v=sql.105).aspx and especially
It is better to restart the service but there is no Restart() method : you will have to do a Stop() and a Start() ( don't forget to do a loop until the end of the Start(), as your program is not pausing until the end of a Stop or a Start
Don't hesitate to post again for more help or explanations
Have a nice day
PS : you should have a look at :
even if it is possible to modify the account of a SQL Server with SMO/WMI , the best and more secure way is to use the SQL Server Configuration Manager ( and i am fond of SMO, but realistic and careful )
Mark Post as helpful if it provides any help.Otherwise,leave it as it is.
- Изменено Papy NormandModerator 28 марта 2012 г. 20:50 PS added
- Помечено в качестве ответа RHUM2 29 марта 2012 г. 12:59
-
29 марта 2012 г. 12:59
Hello Papy Normand !
Thanks for your responses. I'm agree with you on many points, but in my context, I must automate all the environment. So, I have not many choices: no action required by the admin or deployment teams.
Thanks for advance for your ideas / help - Regards - Have a nice day ! RHUM2

