I am looking for a way to get a user's email address from their username. I would get their user name from the sysusers table on the database (SQL Server 2000) Here is an example of what I am talking about:
Example:
sysuser table (not all columns are shown)
ID UserName
1 jmichaels
2 tsmith
3 djones
through stored procs and ASP I would like to get their email address
jmeckley = [email protected]
tsmith = [email protected]
djones = [email protected]
I have added the ActiveDS component to my current project and added Import ActiveDS to the class and the code in the subroutine looks like this:
Dim usr As IADsUser
Dim fulName As String
Set usr = GetObject("WinNT://Microsoft/JSmith,user")
fulName = usr.EmailAddress
The GetObject takes 2 optional arguements
1. File Path
2. Class
If you don't pass a file path you have to pass a class. The string in the GetObject function above came directly from the help file. I do not know what that text means. I do not know if, how, or where to get the active directory file for the user selected from the sysuser table.
Does anyone know if this is possible for 1 user to access another users profile to get the email address so they can send them an email? Thank you for any insight provided on this topic.




Reply With Quote