VBScript Subroutine to Launch Altiris DS Job
Created: 05 Dec 2007 | Updated: 06 Dec 2007 | 1 comment
I wanted a way to launch an Altiris job from a VBScript. After doing some searching online I realized that the axsched.exe command can do this. Here is a subroutine that I created that will launch an Altiris DS job on the system running the VBScript using axsched.exe.
In bold is the actual calling of the Sub that would go in the body of your script. Beware of any quotes in the Deployment Server job names as this will break the vbscript!
This script could be used either in an afterscript on a deployed image to install additional software or could also be called later as a departmental afterscript, installing all the software necessary for a particular department.
Call ScheduleDSJob("job name")
Sub ScheduleDSJob(strJobName)
Dim WshShell, WshNetwork, strDPServer, strDSPath, strComputerName, strTime
Set WshShell = CreateObject("WScript.Shell")
Set WshNetwork = CreateObject("WScript.Network")
strDPServer = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Altiris\Client Service\TcpAddr")
strDSPath = "\\" & strDPServer & "\eXpress\"
strComputerName = WshNetwork.ComputerName
strTime = Year(now) & "-" & Month(now) & "-" & Day(now) & " " & FormatDateTime(now, 4)
WshShell.Run strDSPath & "axsched.exe " & strComputerName & " " & chr(34) & strJobName & chr(34) & " /d " & strDPServer & " /t " & chr(34) & strTime & chr(34) & " /y"
Set WshShell = Nothing
Set WshNetwork = Nothing
WScript.Sleep(1000)
End Sub
Blog Entry Filed Under:
The Endpoint Management Community Blog is the perfect place to share short, timely insights including product tips, news and other information relevant to the Endpoint Management community. Any authenticated Connect member can contribute to this blog.
Comments 1 Comment • Jump to latest comment
Hi,
Very nice script ;)
Question:
If i want to install 3 different jobs and reboot only at the end, do you know a way to do it?
Many thanks,
Mapache
Would you like to reply?
Login or Register to post your comment.