Sunday, January 23, 2011

Locking User account created under Windows Authentication in SQL Server

Hi,

As per my project requirement i need to lock a user in SQL Server(Which is created using Windows Authentication). Is there any way to do this?

Thanks for the help

Santhosh

  • I don't think this will be directly possible in SQL Server, but you could:

    • In SQL Server: Remove all rights from the user (including the ability to connect).
    • Disable the account in Windows.

    As the account is a Windows account, it is up to Windows to lock it.

    K. Brian Kelley : -1 because it is possible to do in SQL Server.
    Richard : @K.Brian: In what way is the first bullet point different to your own answer?
    From Richard
  • How to do this depends on version. I am assuming the Windows user is added explicitly and not through a Windows group.

    In SQL Server 2000, if you are using Enterprise Manager, bring up the properties for the Windows user login. On the General tab you can select Deny Access under Authentication and this will prevent the Windows user from connecting to the SQL Server.

    In SQL Server 2005/2008, there are two ways to do this. Using SQL Server Management Studio, again bring up the properties ofr the Windows user login. Click on the Status page. You can either Deny permission to connect to the database engine or Disable the login or both.

0 comments:

Post a Comment