473,387 Members | 1,535 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,387 software developers and data experts.

Get the client PC Windows user name and PC Name.

Hi

I am trying to get the Windows username and PC name from the client PC
in VB or c#.

I am using 'forms' authentication and 'anonymous access' in IIS. Is it
possible to get the client PC's windows username and Computer Name
whilst using this combination?

Access levels to various pages are stored in an SQL Server table
against their Windows Login Name, which is why I use 'forms'
authentication. The site currently runs accross two domains and may go
external in the future, so I don't want to move away from forms
authentication. The data would be useful for me for logging and so that
Intranet Users don't have to type their user name every time they log
on.

Is there some client-side script that can do this? I have tried using
API's, System.Security and User.Identity to no avail. I can only get as
far as the Server IIS logon name.

Any suggestions would be appreciated.

Thanks

Jared

Jan 3 '06 #1
5 11060
You cannot do this with your configuration. When in "anonymous mode", IIS
does not receive any user information as it is not needed.

"Jared" <ja***********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi

I am trying to get the Windows username and PC name from the client PC
in VB or c#.

I am using 'forms' authentication and 'anonymous access' in IIS. Is it
possible to get the client PC's windows username and Computer Name
whilst using this combination?

Access levels to various pages are stored in an SQL Server table
against their Windows Login Name, which is why I use 'forms'
authentication. The site currently runs accross two domains and may go
external in the future, so I don't want to move away from forms
authentication. The data would be useful for me for logging and so that
Intranet Users don't have to type their user name every time they log
on.

Is there some client-side script that can do this? I have tried using
API's, System.Security and User.Identity to no avail. I can only get as
far as the Server IIS logon name.

Any suggestions would be appreciated.

Thanks

Jared

Jan 3 '06 #2
> Is there some client-side script that can do this?

Not directly with Javascript; you would have to use an ActiveX object,
which would need to be set as trusted on all the network machines
[which could be done through Group Policy].

You could achieve a similar effect by using a cookie to store the
username in the user's profile (though obviously they should still need
to enter a password).

Jan 3 '06 #3
Peter

Thanks for your response. I may have to re-think my security setup or
alternatively, not change anything (if it's not broken, don't fix it).

Cheers Jared

Jan 3 '06 #4
Paul

Thanks for your response.

I am interested in learning more about the ActiveX control method. Do
you have any example you could pass on to me?

Many Thanks

Jared

Jan 3 '06 #5
If you're working with SQL Server, you should look at SYSTEM_USER. It
provides the login ID of the person signed on top the PC, and can be
compared against your security specs in queries or views, etc.

Good luck!

Jan 4 '06 #6

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

Similar topics

3
by: Raj | last post by:
Hi All, Is it possible to detect if a client software is installed on a machine using browser javascript. we are building a web/windows software and when the user logs into the web application,...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
9
by: Eugene | last post by:
I am trying to use db2batch from my XP client against a remote database. And here's what I am getting: C:\work\Tuning\DB2\db2batch> db2batch -d oakl0 -a fs/fs -f db2batch.sql Running in...
2
by: Erik | last post by:
I'm trying to get the login name for the user, and this is the code I use: string userName = WindowsIdentity.GetCurrent().Name; This works fine when the program is launched locally or...
7
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> How can I get the users (client) IP-Address ? I...
2
by: WhatHappend | last post by:
I have converted a .Net 1.0 application to .Net 2.0 and the web service invocations have delay of around 10seconds on each intial access. After the first access subsequent access are fast (After a...
8
by: Brian Tkatch | last post by:
Server: DB2/SUN 8.1.6 Client: DB2 Connect Personal Edition (No 11) <URL:ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP11_WR21365/FP11_WR21365_CONPE.exe> ...
2
by: Frank Swarbrick | last post by:
I am trying to understand "client authentication" works. My environment is DB2/UDB LUW 8.2 on zSeries SLES9 as the database server and DB2 for VSE 7.4 as the client. We currently have DB2/LUW set...
1
by: Mark Morss | last post by:
Is this the place to ask a win32com.client question? I am a unix person trying to run on windows, so I have little familiarity with this module. I have this code: import win32com.client ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.