Orphaned user in SQL server

In our environment there are many SQL servers and many AD ids are there as SQL logins.

If an id deleted from AD then it stays in SQL server as a orphaned login.

I need to cleanup those ids from SQL servers. Now I need a query to validate the user exist in AD or not.

Or Please share if any other way to do it.

Thanks in advance!!

February 24th, 2015 5:56pm

We have below option to query AD users in SQL Server, i.e Linked Server, CLR and OPENROWSET.

http://www.pawlowski.cz/2011/04/querying-active-directory-sql-server-t-sql/

Free Windows Admin Tool Kit Click here and download it now
February 25th, 2015 12:02am

Hello,

You can use sp_validatelogins (Transact-SQL) to validate your Windows Logins.

February 25th, 2015 1:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics