Vinay's profileVinay Thakur - Sql Serve...PhotosBlogLists Tools Help

Blog


    October 22

    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

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://vinay-thakur.spaces.live.com/blog/cns!645E3FC14D5130F2!589.trak
    Weblogs that reference this entry
    • None