I am looking for a way to drop a set of users who belong to the same domain.
The solution I found is something like this:
SELECT * FROM OpenQuery (
'SELECT * FROM ''LDAP://DOMAIN.com/OU=Players,DC=DOMAIN,DC=com''
WHERE objectClass = ''User''
') AS tblADSI
ORDORDER BY displayname
Is there another way?
I am thinking along the line of combining this two
Drop user [myDomain\userX]
Select * from sys.database_principals where name like 'myDomain%'
I appreciate any help!