August 10, 2010 at 6:52 am
I am working on sql server 2005, i have around 400 logins in my security folder.
I want to enforce password policy and enforce password expiration in all the users.
I know its possible by checking the 2 mentioned options from the SSMS GUI in all the users
but it would take me very long to do so.
Is there any way/script to do that(all users at a time)?
Thanks,
Sushant
Regards
Sushant Kumar
MCTS,MCP
August 10, 2010 at 7:25 am
check Alter login...
http://msdn.microsoft.com/en-us/library/ms189828.aspx
This will help you. You just need to create small programme to do it automatically.
HTH
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
August 10, 2010 at 7:43 am
This script will do just for 1 user at a time...
Thanks,
Sushant
Regards
Sushant Kumar
MCTS,MCP
August 10, 2010 at 8:03 am
You need to write some code.
Query sys.server_principals for users, write a loop or cursor with the results, build an ALTER LOGIN script from there.
http://msdn.microsoft.com/en-us/library/ms188786%28v=SQL.100%29.aspx
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply