Tuesday 7 January 2014

CHECK_POLICY and CHECK_EXPIRATION options cannot be turned OFF


I received a request from a developer that an sql server account had expired. They wanted the policy disabled. When I attempted to disable the policy in SSMS i received the error below.


 ------------------------------

Alter failed for Login 'xyz'.  (Microsoft.SqlServer.Smo)

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

The CHECK_POLICY and CHECK_EXPIRATION options cannot be turned OFF when MUST_CHANGE is ON. (Microsoft SQL Server, Error: 15128)


The quick solution is to run this command to disable the policy.

USE [MASTER]
ALTER LOGIN xyz WITH PASSWORD = '%PASSWORD%'
ALTER LOGIN xyz  WITH CHECK_POLICY = OFF,CHECK_EXPIRATION = OFF