SQL that works as it should other than I can't limit to active students
SELECT stud.other_id FROM student stud LEFT JOIN (SELECT * FROM Openquery (adsi, 'SELECT sAMAccountName FROM ''LDAP://.....'' WHERE objectClass = ''User'' '))AD ON stud.other_id = AD.samaccountname AND ad.samaccountname IS NULL
View used to get active students
CREATE VIEW [dbo].[VW_Enrolled_Students] AS SELECT dbo.student.student_id, dbo.student.name_id, dbo.student_ew.entity_id, dbo.student_ew.ew_date, dbo.student.other_id, dbo.student.student_in_stn, dbo.student.grad_yr FROM dbo.student INNER JOIN dbo.student_ew ON dbo.student.student_id = dbo.student_ew.student_id WHERE (dbo.student_ew.withdrawal_date IS NULL) GO
code used to identify missing AD accounts for active students
SELECT Stud.other_id FROM [vw_enrolled_students] Stud left JOIN (SELECT * FROM Openquery (adsi, 'SELECT sAMAccountName FROM ''LDAP://......'' WHERE objectClass = ''User'' ')) AD ON Stud.other_id = ad.samaccountname AND ad.samaccountname IS NULL