Why could I not disable a windows account in SQL Server

  • I have sa on a server. When I tried to disable a Windows account, I came acroos the following error.

    Msg 15151, Level 16, State 1, Line 1

    Cannot alter the login 'domainName\UserAccount', because it does not exist or you do not have permission.

    I tried to use the script below:

    ALTER LOGIN [domainName\UserAccount] DISABLE

    I also tried to manually disable this account on GUI, but got the same eroor.

    What might be the issue?

    Any input will be greatly appreciated.

  • When you attempt to disable that account are you running the query under the context of a sysadmin or securityadmin account?

    Can you confirm that the login itself exists as in individual login on the server (you can do this by checking the permission path is null when running exec xp_logininfo 'domain\account' )

    Shamless self promotion - read my blog http://sirsql.net

  • Yes

  • The only other thing I can think is to check Active Directory and see if the account got moved in to another domain.

    I've seen it happen in the past where the account has been moved, keeps the same SID and shows up in SQL, it can be used, however there is no way of managing it internal to SQL Server.

    Shamless self promotion - read my blog http://sirsql.net

Viewing 4 posts - 1 through 4 (of 4 total)

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