Get Windows User Name

J

Jared

Hi

For some time now I have been looking for some client side script to
get the windows logon id.

My asp.net application is running accross three domains, so windows
authentication is no use to me. In client / server applications it is
simple to retrive the windows user id of the client to save them typing
it in every time. I wanted to replicate this functionality in a web
application.

This script will only work on PC's running Windows and IE, but thats
all we are running, so that's fine. 'Initialize and script ActiveX
controls not marked as safe' needs to be enabled in IE for this to
work.

Hopefully someone will find this useful.

<script language = "vbscript">
Dim Shell
set shell = createobject("wscript.shell")
set env = shell.environment("process")
document.form1.strUserName.value = env("username")
</script>

Cheers

Jared
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top