Ik heb een klein probleempje, ik kan geen description fields lezen uit mijn Active Directory omdat vb zeurt dat het niet kan vinden. Terwijl hij de andere items wel kan vinden ... wat gaat hier fout ?
Dit resulteerd in een "Item cannot be found in the collection corresponding to the requested name or ordinal." op de regel waar de description wordt opgehaald. Dat terwijl hij weldegelijk aanwezig is.
EDIT:
Dit moet zijn een "type mismatch" error. foutje bij typen van voorbeeld etc.
Visual Basic:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| Set objConnection = CreateObject("ADODB.Connection") objConnection.Open "Provider=ADsDSOObject;" Set ObjCommand = CreateObject("ADODB.Command") ObjCommand.ActiveConnection = objConnection ObjCommand.CommandText = _ "<LDAP://" & strDomain & ">;(&(objectClass=CLASS)" & _ "(sAMAccountName=" & "NAAM" & "));distinguishedName,description,name;subtree" Set ObjRecordSet = objCommand.Execute 'Nothing found --> Stop script If ObjRecordSet.recordcount = 0 Then WScript.Echo "No Objects founds." WScript.Quit Else WScript.echo ObjRecordSet.Fields.Item("name") Wscript.echo ObjRecordSet.Fields.Item("distinguishedName") Wscript.echo ObjRecordSet.Fields.Item("description") End If objConnection.Close |
Dit resulteerd in een "Item cannot be found in the collection corresponding to the requested name or ordinal." op de regel waar de description wordt opgehaald. Dat terwijl hij weldegelijk aanwezig is.
EDIT:
Dit moet zijn een "type mismatch" error. foutje bij typen van voorbeeld etc.
[ Voor 12% gewijzigd door Verwijderd op 22-05-2007 12:02 . Reden: Code tags toegevoegd ]