J
Jon Schneider
I am trying to access employee information from Active Directory from my ASP
..Net web application. I have tried several different methods and each fail.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim user As MembershipUser = Membership.GetUser(User.Identity.Name)
userName.Text = user.UserName
emailAddress.Text = user.Email
End Sub
This method returns this error:
Object reference not set to an instance of an object.
at _Default.Page_Load(Object sender, EventArgs e)
The other method I was investigating is using WindowsIdentity. I can access
the SID but I do not know how to utilize the DirectoryEntry, or what to
include to obtain the users email address.
Any help would be greatly appreciated.
..Net web application. I have tried several different methods and each fail.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim user As MembershipUser = Membership.GetUser(User.Identity.Name)
userName.Text = user.UserName
emailAddress.Text = user.Email
End Sub
This method returns this error:
Object reference not set to an instance of an object.
at _Default.Page_Load(Object sender, EventArgs e)
The other method I was investigating is using WindowsIdentity. I can access
the SID but I do not know how to utilize the DirectoryEntry, or what to
include to obtain the users email address.
Any help would be greatly appreciated.