SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 How to set password expiration OFF in 2012
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

asp__developer
Posting Yak Master

108 Posts

Posted - 01/07/2014 :  16:35:40  Show Profile  Reply with Quote
I have a login user that I created in security > logins (in 2012 SQL Server)

Everytime I try to login, it asks me to change the password.

So when I go to the properties of that login, there is a checkbox "Enforce password expiration".

When I try to uncheck / disable it - it gives me error message saying:-

"Alter failed for login 'username'
The CHECK_POLICY and CHECK_EXPIRATION options cannot be turned OFF when MUST_CHANGE is ON"

But the option "User must change password at next login" is checked but not changable - how to uncheck or disable this option for my login ?

asp__developer
Posting Yak Master

108 Posts

Posted - 01/07/2014 :  16:41:55  Show Profile  Reply with Quote
I have tried this:

If you decide to use a query, you can use code similar to this
USE Master
GO
ALTER LOGIN test_must_change WITH PASSWORD = ‘samepassword’
GO
ALTER LOGIN test_must_change WITH
      CHECK_POLICY = OFF,
      CHECK_EXPIRATION = OFF;




But it gives me error

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '‘'.
Msg 15151, Level 16, State 1, Line 1
Cannot alter the login 'MYPASSWORD', because it does not exist or you do not have permission.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37460 Posts

Posted - 01/07/2014 :  16:44:46  Show Profile  Visit tkizer's Homepage  Reply with Quote
You've got the wrong quotes around "samepassword". It should be: 'samepassword'. Your code has the tick marks instead.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

asp__developer
Posting Yak Master

108 Posts

Posted - 01/07/2014 :  16:48:40  Show Profile  Reply with Quote
But I already have one quote in the password as I posted above the query ?

‘samepassword’

As you can see I am not using double quote but still getting error ?
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37460 Posts

Posted - 01/07/2014 :  17:00:28  Show Profile  Visit tkizer's Homepage  Reply with Quote
No, you are using ticks. That's why you are getting the errors. Change it to single quotes. Or copy this and paste over yours: 'samepassword'

'samepassword' is not the same as ‘samepassword’

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000