Login Locked Details

  • Pls let me know which is the view I can access to see the status of a login in terms of whether it is locked or not.

    Also, if I am to pass on this locked status to a DR server which has the same login(meaning if it is locked on prod, it should be locked on DR as well)s, is there any method to do so, since the system table on the DR cannot be directly updated, nor do I see any syntax/sp that can be used to actually lock an account.

    Any help on this would be really great.

    Thanks in advance....

  • Hi Waseem,

    Hope you are doing good.

    You can find out whether the user is locked or not, using the below query.

    SELECT Name FROM SYS.SYSLOGINS WHERE LOGINPROPERTY (name , 'IsLocked') = 1

    You can unlock an user using the below query.

    ALTER LOGIN [Mary5] WITH PASSWORD = '****' UNLOCK ;

    GO

    Hope this helps!

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • Hi Pradeep, thanks a lot for your response..

    Me doing gr8.. how r u doing .. 🙂

    My intend is to lock a login on a DR server, if it is locked on the PROD server. I have created an SSIS package which does a Login Sync automatically, and these locked logins should be passed on to the same state as well to the DR server.

    Is there any way we can actually lock a login on the DR server, once we know it is locked on the PROD server.

    Thanks so much.. 🙂

Viewing 3 posts - 1 through 2 (of 2 total)

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