Show properties page of an given active directory object

Discussion in 'Active Directory' started by A. Hofmeister, Sep 7, 2006.

  1. Hallo Newsgroup,

    this is my problem:
    I am using an VB-Script to search the active directory object for an given
    email address.
    As far the script is working fine. But after selecting the active directory
    object, I want to show its properties page.

    How do I have to change my code to let the object properties page appear?

    This is my scripting code:

    strName = InputBox("Bitte Email des gesuchten Kontos eingeben!")

    If strName = "" Then
    End If

    ' ADODB-Verbindung einrichten
    Set Connection = CreateObject("ADODB.Connection")
    Connection.Provider = "ADsDSOObject"
    Connection.Open "Active Directory Provider"

    'Abfrage formulieren
    Set Command = CreateObject("ADODB.Command")
    Command.ActiveConnection = Connection

    'ADsPath der Domäne ermitteln
    Set root = GetObject("LDAP://rootDSE")
    ADsPath = root.Get("defaultNamingContext")
    'MsgBox "ADsPath der Domäne: " & ADsPath

    'Suchabfrage festlegen
    If (strName="") Then
    sFilter = "(&(objectCategory=person)(objectClass=user))"
    'sFilter =
    & strName & "))"
    sFilter = "(&(objectCategory=person)(mail=" & strName & "))"
    End If

    'An diesen Informationen sind wir interessiert
    sAttribsToReturn = "name,sn, givenName,mail,streetAddress, postalCode,l"

    'Tiefe der Suchabfragge
    sDepht = "subTree"

    'Command zusammensetzen
    query = "<LDAP://" & ADsPath & ">;" & sFilter & ";" & sAttribsToReturn & ";"
    & sDepht
    'MsgBox "Abfrage: " & query
    Command.CommandText = query

    'Abfrage ausführen
    Set rs = Command.Execute

    MsgBox rs.RecordCount & " Benutzerkonten gefunden, die """ & strName & """

    'Wenn genau ein Objekt gefunden wurde Eigenschaften-Dialog anzeigen lassen
    If rs.RecordCount = 1 Then
    End If

    Thanks in advance

    Best regards
    Andreas Hofmeister
    A. Hofmeister, Sep 7, 2006
    1. Advertisements

  2. A. Hofmeister

    WichtelZwerg Guest

    WichtelZwerg, Nov 3, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.