sql Script for finding sql login passwordexpiration days?
Can any one please provide me the script for finding sql login password expiration days and also that will send the alert before one week of expiration? Please provide me the full script because i am not aware of scripting side.
You would want to use the DaysUntilExpiration property returned from `LOGINPROPERTY` to get the number of days until the password expires. select *, LOGINPROPERTY(name, N'DaysUntilExpiration') AS DaysUntilExpiration from sys.server_principals ssp where type_desc = 'SQL_LOGIN' From that you can determine the expiration date, and trigger your alerting accordingly. See: