Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Fri, 28 Oct 2005 13:46:45 +0200,    group: microsoft.public.platformsdk.adsi        back       


Retrieving userCertificate via LDAP   
Hi,

I am trying to retrieve the userCertificate via LDAP with the code below.
Unfortunatly the Recordset which should contain the certificate is always
NULL. With a network sniffer on port 389 I can see that the certificate
arrives. Why is it not in the Recordset? Any ideas?

I use for my sample code ADODB but if you have other suggestions how to
solve my problem I am happy as well.

Kind Regards
MichM

on error resume next
Dim bla As String
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset

err.clear
Set conn = New ADODB.Connection
conn.Provider = "ADSDSOObject"
conn.Open "ADs Provider"
Set rs = conn.Execute( _
            "<LDAP://ldap.myserver.com/dc=myserver,dc=com>;" _
            & 
"(&(mail=test@myserver.com));ADsPath,userCertificate,cn;subtree")

      If rs.RecordCount > 0 And Err.Number = 0 Then
         While Not rs.EOF
            bla = ""
            bla = bla + "," + CStr(rs.Fields(0).Value)
            bla = bla + "," + CStr(rs.Fields(1).Value)
            bla = bla + "," + CStr(rs.Fields(2).Value)
            Debug.Print bla
            rs.MoveNext
          Wend
      End If
conn.Close
date: Fri, 28 Oct 2005 13:46:45 +0200   author:   Michael Mueller

Re: Retrieving userCertificate via LDAP   
ignore this please - found the solution. Thanks!

"Michael Mueller"  wrote in message 
news:uf1$HV72FHA.472@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> I am trying to retrieve the userCertificate via LDAP with the code below.
> Unfortunatly the Recordset which should contain the certificate is always
> NULL. With a network sniffer on port 389 I can see that the certificate
> arrives. Why is it not in the Recordset? Any ideas?
>
> I use for my sample code ADODB but if you have other suggestions how to
> solve my problem I am happy as well.
>
> Kind Regards
> MichM
>
> on error resume next
> Dim bla As String
> Dim conn As ADODB.Connection
> Dim rs As ADODB.Recordset
>
> err.clear
> Set conn = New ADODB.Connection
> conn.Provider = "ADSDSOObject"
> conn.Open "ADs Provider"
> Set rs = conn.Execute( _
>            "<LDAP://ldap.myserver.com/dc=myserver,dc=com>;" _
>            & 
> "(&(mail=test@myserver.com));ADsPath,userCertificate,cn;subtree")
>
>      If rs.RecordCount > 0 And Err.Number = 0 Then
>         While Not rs.EOF
>            bla = ""
>            bla = bla + "," + CStr(rs.Fields(0).Value)
>            bla = bla + "," + CStr(rs.Fields(1).Value)
>            bla = bla + "," + CStr(rs.Fields(2).Value)
>            Debug.Print bla
>            rs.MoveNext
>          Wend
>      End If
> conn.Close
>
date: Fri, 28 Oct 2005 15:44:11 +0200   author:   Michael Mueller

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us