April 30, 2011 at 6:49 pm
Comments posted to this topic are about the item Login Properties
April 30, 2011 at 7:05 pm
May 2, 2011 at 3:12 am
Thanks for the question Steve, I misread the question and got it wrong.
M&M
May 2, 2011 at 3:21 am
Finally, a nice easy point. Thanks for the question.
May 2, 2011 at 7:41 am
Thanks, glad you like the question.
May 2, 2011 at 8:29 am
Good question, I haven't used loginproperty for a long time and had totally forgotten about it.
May 2, 2011 at 8:35 am
Nice easy one, thanks.
May 2, 2011 at 8:49 am
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.
May 2, 2011 at 9:39 am
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
May 2, 2011 at 10:52 am
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
May 2, 2011 at 12:49 pm
Thanks for the question. Nice topic.
May 2, 2011 at 4:04 pm
...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
May 2, 2011 at 11:20 pm
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. 🙂
May 3, 2011 at 12:24 pm
Nice question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
May 3, 2011 at 2:53 pm
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