There's been a few post about retrieving host computername in a Workflow. Here's how I do it:
A little javascript to access the Altiris.SWRAgentUtils which - as I understand it - is used by the Softwareportal (http://<ns-server>/Altiris/SWD/SoftwarePortal.aspx)
I have a form with two textboxes named txt1 and txt2 ( to name a control 'Edit Component -> Functionality tab', check 'Specify Control ID' and type Control ID below)
Add the following code to the form: 'Edit form -> Behavior -tab -> Script - click the elipse(...):
function getPCinfo(){ var objAltiris = new ActiveXObject("Altiris.SWRAgentUtils"); var PCinfo = objAltiris.getMachineInfo(); var PCname = PCinfo.MachineName; var PCguid = PCinfo.MachineGuid; document.getElementById('txt1').value= PCname; document.getElementById('txt2').value= PCguid; }
In the Body Custom Events click Add -> AttrubutesKeyValuePair
In the event-dropdown choose 'onload' and in the Eventhandler type:
getPCinfo()
You're now set to go - click OK and test away.
I'm no javascript-wiz so the script may not work in non-IE enviroments.