Ho trovato il modo per ottenere i dati dell'utente collegato usando WScript...che problemi può dare l'utilizzo di WScript?


function XDocument::OnLoad(eventObj)
{
//Create a WScript.Network object, which provides access to the user data
var objNetwork = new ActiveXObject("WScript.network");

//Retrieve the UserName and write it into the my:UserName field
XDocument.DOM.selectSingleNode("/my:myFields/my:UserName").text
= objNetwork.UserName;

//Retrieve the UserDomain and write it into the my:UserDomain field
XDocument.DOM.selectSingleNode("/my:myFields/my:UserDomain").text
= objNetwork.UserDomain;

//Retrieve the ComputerName and write it into the my:ComputerName field
XDocument.DOM.selectSingleNode("/my:myFields/my:ComputerName").text
= objNetwork.ComputerName;
}