473,395 Members | 1,680 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,395 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 1728
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.