DirectoryEntry("LDAP://CN=Username, CN=users, DC=DomainName") : DirectoryEntry « File Directory « ASP.Net






DirectoryEntry("LDAP://CN=Username, CN=users, DC=DomainName")

<%@ Page %>
<script Language="vb" runat="server">
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

    Dim User As System.DirectoryServices.DirectoryEntry
    Try
    User = New System.DirectoryServices.DirectoryEntry("LDAP://CN=Username, CN=users, DC=DomainName")
        Dim Value As String
        Value = User.Properties("HomeNumber").Item(0)
    Catch
        'Show error message
    Finally
        User.Close()
    End Try
End Sub
</script>

 








Related examples in the same category

1.DirectoryServices.DirectoryEntry
2.DirectoryEntry("LDAP://DomainName", Login, Password)