Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Delete obsolete NT logins

Author  Topic 

cat_jesus
Aged Yak Warrior

547 Posts

Posted - 2009-11-25 : 10:04:39
I have a lot of old NT logins on my SQL servers that I'd like to clean up. When I run the following,


SELECT SUSER_SID(name), name, 'NT Logins' LoginType
FROM syslogins
WHERE isntgroup = 0 AND isntname = 1

I get all of the users and their SIDs, but the obsolete users are in there too. If I take a known deleted NT username and run the following on a new server I get null but I get the old SID back if it's a SQL server they had permissions on.

SELECT SUSER_SID('DOMAIN\OLDUSER')


So I did a little digging and found that SUSER_SID doesn't query the WINDOWS LSA unless it doesn't get a hit from sysxlogins.

How do I query the LSA directly from SQL?





An infinite universe is the ultimate cartesian product.
   

- Advertisement -