Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Logins no longer exists.

Today while checking the logins, just want to clear/clean logins which are no longer exists on NT domain.

To get the logins which are no longer exits run the following:

EXEC master.dbo.sp_validatelogins

http://msdn.microsoft.com/en-us/library/ms181728.aspx

It will show you the list of SID and logins which are not exists. And then after that run the below command to remove that login.

Exec.sp_revokelogin ‘domain\Login name’

http://msdn.microsoft.com/en-us/library/ms188784.aspx

This is old commands and will be remove in future release… so if you are using sql server 2005 and above use below command which will be same as sp_revokelogin.

DROP LOGIN login_name

http://msdn.microsoft.com/en-us/library/ms188012(SQL.90).aspx

You can use the Enterprise Manager or SSMS for the same.

Go to Securities –> logins –> Right click and Delete login.

HTH.

Vinay

twitter @thakurvinay.

Comments

No comments.

Leave a Comment

Please register or log in to leave a comment.