473,289 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Get Windows User Name

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 across 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

May 16 '06 #1
1 1723
Jared,

document.form1.strUserName.value = env("username") did not work for me

But

document.all.form1.strUserName.value = env("username") did work

Thanks for the script

SA
"Jared" <ja***********@gmail.com> wrote in message
news:11*********************@i40g2000cwc.googlegro ups.com...
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 across 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

May 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bob Everland | last post by:
I have an application that is ISAPI and the only way to secure it is through NT permissions. I need to have a way to login to windows authentication so that when I get to the ISAPI application no...
3
by: Steven Fox | last post by:
============================================================ About DB2 Administration Tools Environment ============================================================ DB2 administration tools level:...
5
by: pberna | last post by:
Dear all, I built a Web Form application to start and stop a Windows Service remotely. I successful tested the application on Windows 2000 server + IIS. I must include the ASPNET user to the...
9
by: Alex | last post by:
Get the Name and Phone Number of the Current Windows User in a .NET Application I am writing a simple .NET (C#) application. It needs to "automatic" get the Name (last, first) and phone number...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.