Here ya go.
<%
'get the userName from the form
dim userName as String
userName = Request.Form("userName")
dim con, Com, rs, fullName, description
con = Server.CreateObject("ADODB.Connection")
con.provider = "ADsDSOObject"
con.open("Active Directory Provider")
Com = CreateObject("ADODB.Command")
Com.ActiveConnection = con
Com.CommandText = "SELECT displayName, description, cn FROM
'LDAP://DOMAIN NAME/CN=" & userName & ",OU=GROUP NAME' WHERE
sAMAccountname = '" & userName & "'"
rs = Com.Execute
if not rs.bof and not rs.eof then
fullName = rs("displayName").value
description = rs("cn").value
end if
%>
***** MAKE SURE TO CHANGE THE DOMAIN NAME AND GROUP NAME IN THE LDAP
SELECT STATEMENT. ALSO, YOU WILL NEED TO HAVE AN "OU=" FOR EVERY
GROUP IN YOUR AD HIERARCHY.
Chris
naijacoder naijacoder <> wrote in message news:<>...
> Hi Guys,
> I have <%=User.Identity.Name%> on my asp.net page and i can
> retrieve the Username for example ComputerName/Username or
> DomainName/Username.
> But my Question is how can i retrieve the full username for
> example "John Brown" or the DisplayName.
> Any help from you guys!
>
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!