I'm trying to query the Exchange directory in order to get the DSN of a
mailbox. The following code
works on Windows 2000 Pro SP1, but when I try to run it on a NT4 box with
SP6 and the latest
ADSI, MDAC and WSH installed I get a "-2147221164 Class not registered"
I have tried to run this on two different NT boxes, both returning the same
error. The error occurs
when trying to execute the query, but it doesn't say which class is
missing.. Anyone have any ideas
strUserid = "foobar"
Set connExch = CreateObject("ADODB.Connection")
connExch.Provider = "ADsDSOObject"
connExch.Open "ADs Provider"
vSQL = "SELECT distinguishedName FROM 'LDAP://exchangeserver' WHERE uid='"&
strUserid & "'"
Set rsExch = connExch.Execute(vSQL)