Jump to content

2 Objektklassen im AD per vbs abfragen


Der letzte Beitrag zu diesem Thema ist mehr als 180 Tage alt. Bitte erstelle einen neuen Beitrag zu Deiner Anfrage!

Empfohlene Beiträge

Geschrieben

naja ... das script sieht immer noch so aus: wo wie muss die string-array funktion denn eingebaut werden?

 

Const ADS_SCOPE_SUBTREE = 2

Set fso=CreateObject("Scripting.FileSystemObject")

Set tf=fso.OpenTextFile("SSOWatch.txt",2,1)

Set objConnection = CreateObject("ADODB.Connection")

Set objCommand = CreateObject("ADODB.Command")

objConnection.Provider = "ADsDSOObject"

objConnection.Open "Active Directory Provider"

 

Set objCommand.ActiveConnection = objConnection

objCommand.CommandText = _

"Select distinguishedName from " & _

"'LDAP://DC=test,DC=de' where objectClass='enatelSoftwareModule'" & _

" and enatelSoftwareModuleVersion = '72623751'"

objCommand.Properties("Page Size") = 1000

objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE

Set objRecordSet = objCommand.Execute

objRecordSet.MoveFirst

 

Do Until objRecordSet.EOF

tf.Writeline objRecordSet.Fields("distinguishedName").Value

objRecordSet.MoveNext

Loop

Geschrieben

Probier mal so:

 

Const ADS_SCOPE_SUBTREE = 2
Set fso=CreateObject("Scripting.FileSystemObject")
Set tf=fso.OpenTextFile("SSOWatch.txt",2,1)
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"

Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select distinguishedName from " & _
"'LDAP://DC=test,DC=de' where objectClass='enatelSoftwareModule'" & _
" and enatelSoftwareModuleVersion = '72623751'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst

Do Until objRecordSet.EOF
'tf.Writeline objRecordSet.Fields("distinguishedName").Value
myDN = objRecordSet.Fields("distinguishedName").Value
myDNSplitted = Split(myDN, ",", 2)
tf.Writeline myDNSplitted(1)
objRecordSet.MoveNext
Loop

 

Würde mich auch über ne Erfolgsrückmledung freuen ;)

Der letzte Beitrag zu diesem Thema ist mehr als 180 Tage alt. Bitte erstelle einen neuen Beitrag zu Deiner Anfrage!

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Du musst ein Benutzerkonto haben, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen. Es ist einfach!

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...