I will send you some Delphi code in a couple of hours.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Chris Moore
Sent: Thursday, January 12, 2006 4:37 AM
To: Delphi List (E-mail)
Subject: LDAP


Hello list,

I use scripts (see example) then Delphi applets on the text files that
the scripts produce, to manage my domain, I would like to elminate the
scripts, but I don't know how to access the LDAP through Delphi. Does
anyone know of a component or method?

Cheers - Chris


<example script>

Dim strComputer, oComputer, object, objFileSystem, objOutputFile,
strOutputFile

strOutputFile = "./" & Split(WScript.ScriptName, ".")(0) & ".txt"

Set objFileSystem = CreateObject("Scripting.fileSystemObject")
Set objOutputFile = objFileSystem.CreateTextFile(strOutputFile, TRUE)

strComputer = "LDAP://<< My AD Information >>"

Set oComputer = GetObject(strComputer)

For Each object In oComputer
'If Not object.extensionAttribute1 = "" Then
    objOutputFile.WriteLine(object.name & "," &
padx(object.extensionAttribute1, 6) & "," & object.description) 'End If
Next

objOutputFile.Close

Set oComputer = Nothing
Set objFileSystem = Nothing

Function padx(str, size)
 While len(str) < size
  str = str + " "
 Wend
 padx = str
End Function



_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to