Hi,
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 (
ADSI,
'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]
and
Select * from sys.database_principals where name like 'myDomain%'
But how?
I appreciate any help!