Quantcast
Channel: Symantec Connect - Endpoint Management - Articles
Viewing all articles
Browse latest Browse all 706

How to Get Computername and Guid in Workflow

$
0
0

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)

controlID.JPG

Add the following code to the form: 'Edit form -> Behavior -tab -> Script - click the elipse(...):

script.JPG

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()

tab.JPG
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.

 


Viewing all articles
Browse latest Browse all 706

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>