Ivanti Application Control – Lock

Takes the previously backed up configuration and restore it to the running live configuration.
Version 1.1.5
Created on 2018-05-18
Modified on 2018-05-18
Created by Landon Winburn
Downloads: 30

The Script Copy Script Copied to clipboard
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")

If NOT FSO.FileExists(WshShell.ExpandEnvironmentStrings("%allusersprofile%") & "\AppSense\Application Manager\Configuration\Configuration.aamp") Then
 Wscript.Echo "Application Control not installed."
 Wscript.Quit
End If

If NOT FSO.FileExists(WshShell.ExpandEnvironmentStrings("%temp%") & "\Configuration.aamp") Then
 Wscript.Echo "Machine Locked."
 Wscript.Quit
End If

'Create the configuration
Dim Configuration
Set Configuration = CreateObject("AM.Configuration.5")

'Create the configuration helper
Dim ConfigurationHelper
Set ConfigurationHelper = CreateObject("AM.ConfigurationHelper.1")

Dim ConfigurationXML
ConfigurationXML = ConfigurationHelper.LoadLocalConfiguration(WshShell.ExpandEnvironmentStrings("%temp%") & "\Configuration.aamp")

Configuration.ParseXML ConfigurationXml
ConfigurationHelper.SaveLiveConfiguration Configuration.Xml

FSO.DeleteFile WshShell.ExpandEnvironmentStrings("%temp%") & "\Configuration.aamp"

Wscript.Echo "Machine Locked."