- You have a SQL Server Failover instance that has 2 or more nodes.
- You try to change the password for a SQL Server virtual instance on one of the passive nodes by using SQL Server Management Studio or by using the WMI Provider for Configuration Management.
In this scenario, you expect that the SQL Server instance remains online on the active node. Instead, you find that the instance actually goes offline.
Note We recommend that you use this method if possible.
Schedule the password change during a maintenance window and change the password of the service accounts on each node of the failover cluster with the instance actively running on that node. The password must be changed through Configuration Manager as discussed in How to: Change the Password of the Accounts Used by SQL Server (SQL Server Configuration Manager).
Note When you change the password of the SQL Server service account by using the configuration manager on the active node, this does not change the password for the service account on the passive node. So if you do not change the password on each of the nodes as mentioned above, when a failover occurs, the service account uses the old password and the services using the account will fail to come online on that node with the following error message:
The service did not start due to a logon failureThe MSSQLSERVER service was unable to log on as <Domain\ServiceAcct> with the currently configured password due to the following error:
Login failure: unknown user name or bad password.
Note You can use this method when you cannot afford downtime to make password changes.
- On the current active node change the password using SQL Server Configuration manager as discussed in How to: Change the Password of the Accounts Used by SQL Server (SQL Server Configuration Manager).
- On each of the passive nodes, change the password of the SQL Service account using Service Control manager (Services.msc), immediately after the passwords are changed on the active node through Configuration Manager.
Refer to the following example script if you use this method:
Dim oCluster, oResource, oClusProperty ' Cluster Object, Resource Object, ClusProperty Object Dim strCluster, strResource ' Cluster name, Resource name Dim strWQL, strInstance, strOwnerNode, strPassword ' WMI Query, SQL Server Instance name, Owner node hostname, Password Dim oSqlSvc ' SqlService ClassstrCluster = "ClusterName" ' Cluster Network Name strResource = "SQL Server" ' Resource Name of SQL Server Resource strInstance = "MSSQLSERVER" ' Instance Name. MSSQL$InstanceName if named instances strPassword = "password" ' New password
' Get the owner node of the resource
Set oCluster = CreateObject("MSCluster.Cluster") oCluster.Open strCluster For Each oResource In oCluster.Resources If oResource.Name = strResource Then If oResource.State = 2 Then ' Online For Each oClusProperty in oResource.OwnerNode.CommonROProperties If oClusProperty.Name = "NodeName" Then strOwnerNode = oClusProperty End If Exit For
strOwnerNode = "." ' Connect to the local node if the resource is offline
' Create WMI Query string
strWQL = "" strWQL = strWQL & "WINMGMTS:\\" & strOwnerNode & "\root\Microsoft\SqlServer\ComputerManagement" strWQL = strWQL & ":SqlService.ServiceName='" & strInstance & "'" strWQL = strWQL & ",SQLServiceType=1" 'Set the password.
Set oSqlSvc = GetObject(strWQL) oSqlSvc.SetServiceAccountPassword "", strPassword
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.
Article ID: 972387 - Last Review: Jan 6, 2014 - Revision: 1