Login Properties

  • Comments posted to this topic are about the item Login Properties

  • Steve nice to see all your studying for MCM is turning up in the QODs of late.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Thanks for the question Steve, I misread the question and got it wrong.

    M&M

  • Finally, a nice easy point. Thanks for the question.

  • Thanks, glad you like the question.

  • Good question, I haven't used loginproperty for a long time and had totally forgotten about it.

  • Nice easy one, thanks.

  • Patrick Cahill (5/2/2011)


    Good question, I haven't used loginproperty for a long time and had totally forgotten about it.

    Me too, that's why I liked this question.

  • Here is a simple little script with all the options of loginproperty against all logins.

    SELECT name AS LoginName

    ,loginproperty(name,'BadPasswordCount') AS BadPasswordCount

    /* Returns the number of consecutive attempts to log in with an incorrect password.*/

    ,loginproperty(name,'BadPasswordTime') AS BadPasswordTime

    /* Returns the time of the last attempt to log in with an incorrect password.*/

    ,loginproperty(name,'DaysUntilExpiration') AS DaysUntilExpiration

    /* Returns the number of days until the password expires.*/

    ,loginproperty(name,'DefaultDatabase') AS DefaultDatabase

    /* Returns the SQL Server login default database as stored in metadata or master if no database is specified. Returns NULL for non-SQL Server provisioned users; for example, Windows authenticated users.*/

    ,loginproperty(name,'DefaultLanguage') AS DefaultLanguage

    /* Returns the login default language as stored in metadata. Returns NULL for non-SQL Server provisioned users, for example, Windows authenticated users.*/

    ,loginproperty(name,'HistoryLength') AS HistoryLength

    /* Returns the number of passwords tracked for the login, using the password-policy enforcement mechanism. 0 if the password policy is not enforced. Resuming password policy enforcement restarts at 1.*/

    ,loginproperty(name,'IsExpired') AS IsExpired

    /* Returns information that will indicate whether the login has expired. */

    ,loginproperty(name,'IsLocked') AS IsLocked

    /* Returns information that will indicate whether the login is locked. */

    ,loginproperty(name,'IsMustChange') AS IsMustChange

    /* Returns information that will indicate whether the login must change its password the next time it connects. */

    ,loginproperty(name,'LockoutTime') AS LockoutTime

    /* Returns the date when the SQL Server login was locked out because it had exceeded the permitted number of failed login attempts.*/

    ,loginproperty(name,'PasswordHash') AS PasswordHash

    /* Returns the hash of the password.*/

    ,loginproperty(name,'PasswordLastSetTime') AS PasswordLastSetTime

    /* Returns the date when the current password was set.*/

    FROM sys.syslogins

  • wohoo - thanks

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Thanks for the question. Nice topic.

  • ...a-ha-ha-hand learning

    ...a-ha-ha-hand learning

    ...a-ha-ha-hand learning

    ...a-ha-ha-hand learning....

    Great question!

    Peter Trast
    Microsoft Certified ...(insert many literal strings here)
    Microsoft Design Architect with Alexander Open Systems

  • Thanks for the question, however I'd like to point out that as per MSDN,

    The values of the PasswordHash and PasswordLastSetTime properties are available on all supported configurations of SQL Server, but the other properties are only available when SQL Server is running on Windows Server 2003 and both CHECK_POLICY and CHECK_EXPIRATION are enabled.

    Just a little bit of information for those who are reading the posts. 🙂

  • Nice question, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Another good question, keep-em coming.

Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic. Login to reply