nhurst1369
MIS
The following code was posted by Summersl near the bottom of thread774-356151 and returns the users Name and Email Address. I got this code to work right away without having to prompt for username / password or enabling Integrated Windows Authentication or changing other security settings. My question is, is there a downside to using this code compared to the standard ADODB.Connection methods that are posted everywhere else.
<%@ Language=VBScript %>
<%
Option Explicit
Dim objSysInfo, adsUser, User, Email
%>
<html>
<head>
</head>
<body>
<%
Set objSysInfo = CreateObject("ADSystemInfo")
Set adsUser = GetObject("LDAP://" & objSysInfo.username)
User=adsUser.CN
Email=adsUser.EmailAddress
Response.write User&"<br>"
Response.write Email&"<br>"
%>
</body>
</html>
<%@ Language=VBScript %>
<%
Option Explicit
Dim objSysInfo, adsUser, User, Email
%>
<html>
<head>
</head>
<body>
<%
Set objSysInfo = CreateObject("ADSystemInfo")
Set adsUser = GetObject("LDAP://" & objSysInfo.username)
User=adsUser.CN
Email=adsUser.EmailAddress
Response.write User&"<br>"
Response.write Email&"<br>"
%>
</body>
</html>