February 22, 2016 at 4:51 pm
Comments posted to this topic are about the item Change SQL Server Service Accounts with Powershell
February 24, 2016 at 12:02 pm
Why stop and start the services to change the password?
February 24, 2016 at 1:38 pm
I just tested it on my 2014 box several times and took out the stop and start of the service and the account was changed however, it caused some issues and the Agent will not come online.
This is what I had always gone by
From MSDN.. https://msdn.microsoft.com/en-us/library/ms345578.aspx
When you change the service startup account for the Database Engine and SQL Server Agent, the SQL Server service (the Database Engine) must be restarted for the change to take effect. When the service is restarted, all databases associated with that instance of SQL Server will be unavailable until the service successfully restarts. If you have to change the service startup account of SQL Server or SQL Server Agent, make sure that you do so during regularly scheduled maintenance or when the databases can be taken offline without interrupting daily operations.
February 24, 2016 at 1:46 pm
thedspaincrew (2/24/2016)
I just tested it on my 2014 box several times and took out the stop and start of the service and the account was changed however, it caused some issues and the Agent will not come online.This is what I had always gone by
From MSDN.. https://msdn.microsoft.com/en-us/library/ms345578.aspx
When you change the service startup account for the Database Engine and SQL Server Agent, the SQL Server service (the Database Engine) must be restarted for the change to take effect. When the service is restarted, all databases associated with that instance of SQL Server will be unavailable until the service successfully restarts. If you have to change the service startup account of SQL Server or SQL Server Agent, make sure that you do so during regularly scheduled maintenance or when the databases can be taken offline without interrupting daily operations.
That is when you change the account, not the password.
February 24, 2016 at 1:54 pm
This script changes both the account and password.
February 24, 2016 at 1:59 pm
thedspaincrew (2/24/2016)
This script changes both the account and password.
Ahhhh, My apologies. It would help if I actually read through the entire script.
February 24, 2016 at 2:02 pm
No worries. Thanks for taking the time to check it out.
Michael
February 24, 2016 at 2:05 pm
It's a great script, I like it. I hardly ever change the account but I change the service passwords every 30 days.
March 9, 2016 at 4:48 pm
Thanks for the script.
March 10, 2016 at 9:23 am
right on. thanks for checking it out.
Michael
March 25, 2016 at 2:29 am
Hi,
thanks for sharing.
While I was reading the script, I've noticed a little display bug:
if($changestatus.returnvalue -eq 0)
{
write-host $server'......service change successfull' -BackgroundColor Blue -ForegroundColor White
}
if($changestatus.returnvalue -gt 0) ##if fails see what the return value is. this link describes the return values https://msdn.microsoft.com/en-us/library/windows/desktop/aa393660(v=vs.85).aspx
{
write-host $server'......service change successfull' -BackgroundColor red -ForegroundColor yellow
}
The same goes for SQL Agent message when the change fails.
Regards.
March 25, 2016 at 8:06 am
thanks i will take a look at that
Michael
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply