List,

I have a Vendor form (ARS 6.3) connected to Active Directory (Windows
2003), and it works fine.  The 'Vendor Information' setting for the form
is "ldap://ServerName/DC=pbsj,DC=com??sub?(objectclass=user)".  I can
query this Vendor form for a specific user just like any other Remedy
form, and it's quick.

I want to be able to query a specific user in Active Directory from
within a SQL Server 2000 function.  

In SQL, this function below does work for a user named, literally,
'LoginName'.  Unfortunately, with the OPENQUERY system function the
SELECT statement must be a literal string without variables (ie. can't
use variable @LoginName to substitute for 'LoginName').  

SELECT * FROM OPENQUERY(ADSI, 'SELECT msExchHomeServerName FROM
''LDAP://ServerName'' WHERE objectClass=''User'' AND
objectCategory=''Person'' AND sAMAccountName=''LoginName''') 

I don't think I can query the Vendor form from within SQL Server because
it is not a SQL View (like other forms).  For example:  SELECT * FROM
MyRemedyVendorForm WHERE sAMAccountName = 'LoginName'

Does anyone know of a way to query Active Directory by a single user
name within SQL Server? 

Thanks.

*I can pull back All users (4000+) from AD and then search through the
results, however this is too resource intensive.  Another option is to
create a .Net console app and then run it. I want avoid this option if
possible, at least until our production server uses SQL Server 2005
because I can then create a SQL function using .Net which will run very
fast.
 
Stephen

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the 
Answers Are"

Reply via email to