How to retrieve Assoc-NT-Account in format DOMAIN/USER from LDAP


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How to retrieve Assoc-NT-Account in format DOMAIN/USER from LDAP

  1. #1
    Guest

    How to retrieve Assoc-NT-Account in format DOMAIN/USER from LDAP

    How to retrieve Assoc-NT-Account in format DOMAIN/USER from LDAP
    Is there any way? I got some array but I dont know what to do next.

    Im trying this but it isnt working:


    Dim myLDAP As IADsContainer
    Dim Member As IADsUser
    Dim strText() As Variant

    Set myLDAP = GetObject("LDAP://servername/o=org/ou=unit./cn=Recipients")

    For Each Member In myLDAP
    If Member.Class = "organizationalPerson" Then
    Member.GetInfoEx Array("Assoc-NT-Account"), 0
    ReDim strText(256)
    strText = Member.GetEx("Assoc-NT-Account")
    End If
    Next Member

    End Sub


    --
    -----------------------------------------------
    Endys Miroslav
    endys@atlas.cz

    PGP Fingerprint: D1B9 A6A6 AE86 C9C8 FABB 55E0 50E2 8812 9910 04C2


    Share on Google+

  2. #2
    L.J. Johnson Guest

    Re: How to retrieve Assoc-NT-Account in format DOMAIN/USER from LDAP

    Endys,

    I don't have Exchange to test this on but according to the docs:

    "When creating an Exchange mailbox, you must associate the mailbox with a
    Windows NT account. This value is stored in the Assoc-NT-Account attribute
    of the mailbox. This value is the SID, which is the binary representation of
    the Windows NT account. Again, ADSI is capable of setting the value of this
    attribute once it's created, but cannot create the attribute from a
    domain\username pair such as "NORTHAMERICA\jsmith"."

    Once you have the SID, you should be able to use syntax like the following
    to get the rest of the user info:
    Dim x As IADs
    Set x = GetObject("LDAP://servername/<GUID=xxx>")
    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnsn@Flash.Net or LJJohnson@mvps.org
    <http://www.flash.net/~ljjohnsn>
    Ask The NT Pro at <http://www.inquiry.com>



    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center