I'm trying to connect to a specific OU in MyCompany.com active directory. Let's call the OU "MyClient"
First, I tried the code below. It connects and forms the rs but returns an error Run-time error 13 Type Mismatch. It blows up on the Debug.Print line. In the immediate window, I check:
Any idea why this is not returning AD object information? The rs shows a recordcount of 1000.
Specifically, I'm hoping to loop through AD user objects and update some of their properties. Thanks very much for the help!
I'm using the following chunk of code:
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Set conn = New ADODB.Connection
conn.Provider = "ADSDSOObject"
conn.Open "ADs Provider"
Set rs = conn.Execute( _
While Not rs.EOF
Debug.Print rs.Fields(0).Value, rs.Fields(1).Value, _