Friday, October 8, 2010

Alter user with must_change in SQL Server 2005

Open the management studio and connect to the server with sufficient rights
start a blank query
run "ALTER LOGIN X WITH PASSWORD = 'Y' UNLOCK" (replace X & Y with username and password of course)
By following the above steps you should now be able to go back to the user and uncheck the checkboxes without any trouble.

To make the changes without using the management studio you can run the following in a query..

To change the password and keep the MUST_CHANGE flag: ALTER LOGIN X WITH PASSWORD = 'Y' UNLOCK MUST_CHANGE

To uncheck the checkboxes for expiration and/or policy (change "OFF" to "ON" to check): ALTER LOGIN X WITH CHECK_EXPIRATION = OFF ALTER LOGIN X WITH CHECK_POLICY = OFF



Example:

1.ALTER LOGIN afm WITH CHECK_EXPIRATION = on

2.ALTER LOGIN afm WITH CHECK_POLICY = on

3.ALTER LOGIN afm WITH PASSWORD = '1.oracle' UNLOCK MUST_CHANGE

4. To uncheck the checkboes after user change his password

No comments:

Post a Comment