Trying to query AD on a linked server error message is 7321
At a minimum, in the outer query you want SamAccountName which you are using within the openquery as a filter but do not have in your select list there.

Whether that's the root issue or just a byproduct of you doctoring this up for the site remains to be seen.

Select Name, EmployeeID, Mail, SamAccountName
FROM OPENQUERY(ADSI, 'SELECT Name, EmployeeID, Mail, SamAccountName
FROM ''LDAP://DC=mydomain,DC=com''
WHERE  objectClass=''user'' AND EmployeeID &gt; 0 and SamAccountName = ''f.bower''')