Get the client PC Windows user name and PC Name.

J

Jared

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
 
P

Peter Rilling

You cannot do this with your configuration. When in "anonymous mode", IIS
does not receive any user information as it is not needed.
 
P

Paul Henderson

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).
 
J

Jared

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
 
J

Jared

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
 
B

Bill Yellin

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!
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top