Get login details using JavaScript

Issue
Get agent login details using javascript

Solution
<script type="text/javascript" language="javascript">  
  var objUserInfo = new ActiveXObject("WScript.network");  
  document.write(objUserInfo.ComputerName);  
  document.write(objUserInfo.UserDomain);  
  document.write(objUserInfo.UserName);  
</script>