I'm trying to display the OU (or the full ADSPath) in ASP using the
following code:
<%
Set con = CreateObject("ADODB.Connection")
con.Provider = "ADsDSOObject"
con.Open "Active Directory Provider"
Set ocommand = CreateObject("ADODB.Command")
ocommand.ActiveConnection = con
ocommand.CommandText =
"<LDAP://DC=MY,DC=DOMAIN>;(name=MYCOMPUTERNAME);adspath;subTree"
Set RS = ocommand.Execute
While not RS.EOF
Response.write RS.fields(0)
RS.MoveNext
Wend
%>
The script works, but it returns:
LDAP://DC=mycomputername,DC=my.domain,CN=MicrosoftDNS,CN=System,DC=my,DC
=domain
As you can see, there is no OU information listed. I've tried several
different methods of returning the ADSPath and I always get the above
output. The same script works perfectly as a VBScript.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!