Re: How to get ou of an user

From: Jan Peter Stotz (jp_news_at_gmx.de)
Date: 05/27/05

  • Next message: Jan Peter Stotz: "Re: How to get LDAP directory server"
    Date: Fri, 27 May 2005 11:12:10 +0200
    
    

    dl wrote:

    > Thanks Jan. But what is returned by the GetDirectoryEntry().Parent.Path?
    > can you give a sample format please?

    The "DirectoryEntry.Path Property" is a String property. For a detailed
    description search the .Net Framwork SDK Documentation.

    VB.NET:

    Dim searcher as new DirectorySearcher("LDAP://dc=yourdomain,dc=com")
    searcher.Filter="(&(objectClass=user)(samaccountname=" & username & "))"
    Dim result as SearchResult = searcher.FindOne
    Dim userEntry as DirectoryEntry = result.GetDirectoryEntry()
    Dim containerEntry as DirectoryEntry = userEntry.Parent
    Dim String containerPath = containerEntry.Path

    Jan


  • Next message: Jan Peter Stotz: "Re: How to get LDAP directory server"

    Relevant Pages

    • Re: Get SAMAccountNames for all users in an active directory group
      ... what is the point of the impersonation code? ... Dim arrListSAMAccounts As New ArrayList ... Dim searchRoot As DirectoryEntry = Nothing ...
      (microsoft.public.windows.server.active_directory)
    • System.Byte[] And System.__ComObject in Active Directory LDAP brow
      ... If you use the DirectoryEntry, it marshals the value as an ADSI ... dim pwdDate as DateTime ... Imports System.DirectoryServices ... Private Sub LDAPBrowser_Load(ByVal sender As System.Object, ...
      (microsoft.public.dotnet.general)
    • System.Byte[] And System.__ComObject in AD LDAP Browser
      ... If you use the DirectoryEntry, it marshals the value as an ADSI ... dim pwdDate as DateTime ... Imports System.DirectoryServices ... Private Sub LDAPBrowser_Load(ByVal sender As System.Object, ...
      (microsoft.public.dotnet.languages.vb)
    • Re: ADODB to ADO.NET conversion
      ... DirectoryEntry item = result.GetDirectoryEntry; ... Dim entry As New ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
      (microsoft.public.dotnet.framework.aspnet)
    • .net code to create AD user account
      ... Dim objADAM As DirectoryEntry ' Binding object. ... Dim strDisplayName As String ' Display name of user. ... Dim strUser As String ' User to create. ...
      (microsoft.public.dotnet.languages.vb)