Veeral,
Here is the javascript code to do what you are asking.
However, there are a host of security protocols that come into play to allow it
to work in a browser. The mid-tier server will most definitely need to be in
the trusted list. You may also need to customize other security rules to allow
it to work. I suppose I am saying it can be done because I have seen it.
However, I don't recommend it from a security standpoint.
<script type="text/javascript">
<!--script
var wshell = new ActiveXObject("WScript.Shell");
var user = (wshell.ExpandEnvironmentStrings("%USERNAME%"));
document.write(user)
-->
HTH,
Wes
From: Action Request System discussion list(ARSList)
[mailto:[email protected]] On Behalf Of Veeral Oza
Sent: Wednesday, May 05, 2010 7:35 AM
To: [email protected]
Subject: Windows UserID
**
Hi,
I am stuck at this requirement and was wondering if this is feasible to
implement:
1) When an Incident is resolved, an email goes to the customer to submit a
survey, with a survey link.
2) The link opens the survey form in the brower without the user authenticating
in the midtier. A surver-user with a restricted read license is created for
this purpose which allows multiple people from multiple locations to submit the
survey.
3) There is a submit button on this survey form.
4) When the user clicks on submit button, it is required that, his Windows User
ID be captured in one of the fields.
_______________________________
Solutions implemented that did not work:
1)
Create a little Java function in a .jsp file and put it in your "shared"
folder on your Midtier:
Name the file something like /arsys/shared/get_remote_user.jsp.
get_remote_user.jsp contains:
function env_ip_var()
{
var return_value = "<%=request.getRemoteUser()%>";
return (return_value)
}
In the Web Header content of the form you want to capture this on,
add...
<SCRIPT src="/arsys/shared/get_remote_user.jsp"
language="JavaScript"></SCRIPT>
To set a field with the data from the JavaScript functions do the
following in an active link...
Run Process Command Line:
javascript:window.F(XXXXXXXX).DoSet(env_hostname());
Be sure to change XXXXXXXX with the field ID of the field you want to
set.
This did not work, function env_ip_var returns null.
____________________________________________
Solution 2:
A set fields actions in an active link:
$PROCESS$ CMD /C "set username"
This worked only in user tool. However this functionality is required for web.
___________________________________________
If you have any other ideas, please do share.
Regards,
Veeral Oza
_attend WWRUG10 www.wwrug.com ARSlist: "Where the Answers Are"_
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"