get windows2000 login id from a domain

Try to get windows2000 login id from a domain.  The following doesn't work and return blank.  Thanks.

            usern = LCase(Replace(LCase(Request.ServerVariables("LOGON_USER")), "DOMAIN\", ""))

ewang1205Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
tusharashahConnect With a Mentor Commented:
To get UserName of a domain user:

  - Disable Annonymous Access (from IIS)
  - Turn on Windows Authentication (in Web.Config)  (<authentication mode="Windows" />)
  - Use 'User.Identity.Name' or Request.ServerVariables("LOGON_USER") or Request.ServerVariables("REMOTE_USER") to retrive Username

-tushar
0
 
TorrwinCommented:
Try usern=context.user.identity.name
0
All Courses

From novice to tech pro — start learning today.