View Single Post
 
Old January 4th, 2013, 07:40 AM
sonali sonali is offline
Registered User
Points: 43, Level: 1
Points: 43, Level: 1 Points: 43, Level: 1 Points: 43, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2012
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default [Pro_ASP_How] LDAP AD full name and email address based on Logged in user

hi philip,

Now I am able to get the AD Full name and e-mail address with following code
<%

Dim objSysInfo, objUser
Set objSysInfo =server.CreateObject("ADSystemInfo")

' Currently logged in User
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
' or specific user:
'Set objUser = GetObject("LDAP://CN=johndoe,OU=Users,DC=ss64,DC=com")
response.Write(objUser.FirstName & " ")
response.Write(objUser.mail)
%>

However this works in my localhost,it is erroring when I try with my IP Address or if I run in any other machine.It gives me the following error.

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied
/CIA_PTT/Preview.asp, line 7

I have even tried with multiple other ways ,all works in localhost(http://localhost/ADData.asp) but not with my IP ((http://10.140.28.87/ADData.asp)