February 7, 2007 at 9:40 am
i am trying to creat a password policy that will also check the date that the password was created. This will look into the sysxlogins table on the master db and get the creation date from there. I know this is not an overly complex code setup but i dont work too well with DATEDIFF or any date coding . I would like the sp or function to check to make sure the login created is not over 60 days old. From that point i can modify to have it check and kick out messages when it gets closer to the 60 mark and expires. Thanks for any help
DHeath
February 7, 2007 at 9:49 am
i believe xdate1 is creation date, while xdate2 is last changed date?
this would list all users that havne't changed their pass in >60 days i think. yould probalby use this as the basis of a sp or function.
SELECT name ,DATEDIFF(day, xdate2, getdate()) AS no_of_days,* from sysxlogins where DATEDIFF(day, xdate2, getdate()) > 60
Lowell
February 7, 2007 at 9:52 am
SELECT *,DATEDIFF(d,xdate1,GETDATE()) AS Days FROM sysxlogins WHERE xdate1 > DATEADD(d,-60,GETDATE())
Should give the Logins created with in last 60 days
Prasad Bhogadi
www.inforaise.com
February 7, 2007 at 9:54 am
I believe I was typing when you posted it
Prasad Bhogadi
www.inforaise.com
February 7, 2007 at 10:40 am
Thanks a TON for the help..much appreciated...
DHeath
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply