Quantcast
Viewing all articles
Browse latest Browse all 9

Kaseya Script to get OS Install Date

This script pulls the Original Install date from the system info and writes it to a custom field in the Machine Summary on the Audit tab.

Step 1:

Click on Audit then Machine Summary.  In the top left of the right pane, click the “New Custom Field” button.  Type “Orignal Install Date” (without the quotes) and leave it as a string.

Step 2:

Import the script and run it.  The Original Install Date (as noted in System Info) will populate the custom field at the bottom of the Machine Summary Page.

<?xml version="1.0" encoding="utf-8"?>
<ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">  
<Procedure name="System Install Date" treePres="3" id="1325867912" folderId="71817821612791213127822581">    
<Body description="Get System install date and write it to the custom Audit field: Original Install Date.">      
<Statement description="Attempts to return results of a shell command to a global variable '#global:cmdresults#'" name="Execute Shell Command - Get Results to Variable" continueOnFail="false">        
<Parameter xsi:type="StringParameter" name="Parameter1" value="systeminfo|find /i &quot;Original Install Date&quot;" />        
<Parameter xsi:type="StringParameter" name="Parameter2" value="false" />        
<Parameter xsi:type="StringParameter" name="Parameter3" value="User" />      
</Statement>      
<Statement description="Update the selected System Info field with the specified value for the agent this procedure runs on." name="UpdateSystemInfo" continueOnFail="false">        
<Parameter xsi:type="StringParameter" name="ColumnName" value="Original Install Date" />        
<Parameter xsi:type="StringParameter" name="Value" value="#global:cmdresults#" />      
</Statement>    
</Body>  
</Procedure>
</ScriptExport>
Not the most elegant script but it gets the job done.

Viewing all articles
Browse latest Browse all 9

Trending Articles