Forum Moderators: open

Message Too Old, No Replies

Fetching Logged on user

Fetching Logged on user

         

avinash

12:07 pm on Mar 18, 2009 (gmt 0)

10+ Year Member



Hi Experts,

I am new to java.

I have to fetch current logged on user from windows in order to make a URL single sign on.

I found few code from below link

[webmasterworld.com...]

Code

<script type="text/javascript">
<!--
var WinNetwork = new ActiveXObject("WScript.Network");
alert(WinNetwork.UserName);
//-->
</script>

Problem is this code always asks user to Activate ActiveXObject.

Is there any way to stop pop message ?

Or

Any other code available in java/VB script to get current logged on user ?

Thanks,
Avinash

whoisgregg

8:43 pm on Mar 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, avinash!

The only way to access Windows OS level stuff is through ActiveX and for security reasons that always requires user approval. If this isn't for an intranet application, that approach won't work for any other operating system.

If it is an intranet environment, there may be a way to grant permission to your site to use activex across all the machines, but it wouldn't be via javascript, it'd be via the system settings.