x

MS SQL SERVICE LOG ON ACCOUNT?

How to change SQL Server Service log on account using cmd command or powershell?
more ▼

asked Jun 14, 2011 at 10:54 PM in Default

Amardeep gravatar image

Amardeep
1.3k 87 88 89

(comments are locked)
10|1200 characters needed characters left

4 answers: sort voted first
more ▼

answered Jun 14, 2011 at 11:14 PM

Cyborg gravatar image

Cyborg
10.6k 36 40 45

Thanks for your respond but I need to change this across 3000 different servers and these all are on different SQL version even I am not sure that Power shell is available on server. Is there any other way through this I can do it by window cmd command using cmdshell.
Jun 15, 2011 at 01:47 AM Amardeep
(comments are locked)
10|1200 characters needed characters left

Before you go too far down this path I would strongly suggest looking at this [Microsoft article][1] for guidance on the ramifications of doing it and the related changes required.

If you are going to try via a CMD script you may want to investigate using the SC command with the config option.

SC config [service name] obj= [account] password= [password]

[1]: http://support.microsoft.com/kb/283811
more ▼

answered Jun 15, 2011 at 06:24 AM

Blackhawk-17 gravatar image

Blackhawk-17
11.9k 28 31 37

Yes, you would think that SSCM uses WMI in the background to show you SQL Server configuration information and applying changes you make so if I just go straight to WMI through PowerShell instead of the GUI would it do the same? I have not tested this but it is something to keep in mind.
Jun 15, 2011 at 06:34 AM Shawn_Melton
@meltondba - there are a lot more changes being made then just the account in the Services applet. There are group memberships, NTFS permissions, Registry permissions,... A lot of stuff is involved for a seemingly simple change.
Jun 15, 2011 at 06:37 AM Blackhawk-17
Thanks, It is really useful to check read article for change the service log on account, I know that we can change log on account through SQL Server configuration Manager but how we can change it through SQL Server Enterprise Manager.
Jun 15, 2011 at 09:50 PM Amardeep

(1) Is all given below option required to change separately in memberships, NTFS permissions, Registry Permission etc. (Change MS SQL Service Log On account)

(a) WMI. (b) Window CMD sc command.( SC config [service name] obj= [account] password= [password]) (c) Powershell. (d) VB scripts.

(2) Is all above option available across all SQL Versions.

(3) Is all above four option installed with SQL Server.
Jun 15, 2011 at 10:08 PM Amardeep
Due to the complexity of the behind-the-scenes-tech all the changes are required.
Jun 16, 2011 at 05:57 AM Blackhawk-17
(comments are locked)
10|1200 characters needed characters left
more ▼

answered Jun 15, 2011 at 05:15 AM

sp_lock gravatar image

sp_lock
9.3k 25 28 31

(comments are locked)
10|1200 characters needed characters left

To change the service account in SQL Enterprise Manager:
Open Enterprise Manager
Drill down Microsoft SQL Servers > SQL Server Group
Right-Click on your instance > Select Properties
Under the Security Tab you should have a "Startup Service Account"
Set your username and password.
I believe it will prompt you to restart.

In doing it I can say it should set all the OS level permissions that it needs, but it would not hurt to take the KB article @Blackhawk-17 provided to just verify the settings are correct.

FYI: If you had provided the version of SQL Server you were running an answer would have come to you much quicker. Just saying :)
more ▼

answered Jun 16, 2011 at 11:18 AM

Shawn_Melton gravatar image

Shawn_Melton
5.4k 20 21 29

Hard to script the GUI :)
Jun 16, 2011 at 12:13 PM Blackhawk-17
OH...yeah forgot that part of the OP...oops
Jun 16, 2011 at 12:14 PM Shawn_Melton
Thanks but mine requirement to change SQL Server Log on account across 3000 Servers and these all are on different-2 versions. So I want to do this through application upgrade by cmd command using cmdshell.
Jun 16, 2011 at 10:01 PM Amardeep
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x476

asked: Jun 14, 2011 at 10:54 PM

Seen: 1835 times

Last Updated: Jun 14, 2011 at 10:54 PM