Deploy Scripts Using Msiexec
Focus
Focus
GlobalProtect

Deploy Scripts Using Msiexec

Table of Contents
End-of-Life (EoL)

Deploy Scripts Using Msiexec

On Windows endpoints, you can use the Windows Installer (Msiexec) to deploy the GlobalProtect app, app settings, and scripts that the app will run automatically (see Customizable App Settings). To do so, use the following syntax:
msiexec.exe /i GlobalProtect.msi <SETTING>="<value>"
Msiexec is an executable program that installs or configures a product from a command line. On systems running Microsoft Windows XP or later releases, the maximum string length that you can use at the command prompt is 8,191 characters.
This limitation applies to the command line, individual environment variables (such as the USERPROFILE variable) that are inherited by other processes, and all environment variable expansions. If you run batch files from the command line, this limitation also applies to batch file processing.
For example, to deploy scripts that run at specific connect or disconnect events, you can use syntax similar to the following examples:

Example: Use Msiexec to Deploy Scripts that Run Before a Connect Event

For a script that you can copy and paste, go here.
msiexec.exe /i GlobalProtect.msi 
PREVPNCONNECTCOMMAND="%userprofile%\pre_vpn_connect.bat c: test_user" 
PREVPNCONNECTCONTEXT="user" 
PREVPNCONNECTTIMEOUT="60" 
PREVPNCONNECTFILE="C:\Users\test_user\pre_vpn_connect.bat" 
PREVPNCONNECTCHECKSUM="a48ad33695a44de887bba8f2f3174fd8fb01a46a19e3ec9078b011
8647ccf599" 
PREVPNCONNECTERRORMSG="Failed executing pre-vpn-connect action." 
For a complete list of settings and the corresponding default values, see Customizable App Settings.

Example: Use Msiexec to Deploy Scripts that Run at Pre-Connect, Post-Connect, and Pre-Disconnect Events

For a script that you can copy and paste, go here.
msiexec.exe /i GlobalProtect.msi 
PREVPNCONNECTCOMMAND="%userprofile%\pre_vpn_connect.bat c: test_user" 
PREVPNCONNECTCONTEXT="user" 
PREVPNCONNECTTIMEOUT="60" 
PREVPNCONNECTFILE="C:\Users\test_user\pre_vpn_connect.bat" 
PREVPNCONNECTCHECKSUM="a48ad33695a44de887bba8f2f3174fd8fb01a46a19e3ec9078b011
8647ccf599" 
PREVPNCONNECTERRORMSG="Failed executing pre-vpn-connect action." 
POSTVPNCONNECTCOMMAND="c:\users\test_user\post_vpn_connect.bat c: test_user" 
POSTVPNCONNECTCONTEXT="admin" 
POSTVPNCONNECTFILE="%userprofile%\post_vpn_connect.bat" 
POSTVPNCONNECTCHECKSUM="b48ad33695a44de887bba8f2f3174fd8fb01a46a19e3ec9078b011
8647ccf598" 
POSTVPNCONNECTERRORMSG="Failed executing post-vpn-connect action." 
PREVPNDISCONNECTCOMMAND="%userprofile%\pre_vpn_disconnect.bat c: test_user" 
PREVPNDISCONNECTCONTEXT="admin" 
PREVPNDISCONNECTTIMEOUT="0" 
PREVPNDISCONNECTFILE="C:\Users\test_user\pre_vpn_disconnect.bat" 
PREVPNDISCONNECTCHECKSUM="c48ad33695a44de887bba8f2f3174fd8fb01a46a19e3ec9078b0
118647ccf597" 
PREVPNDISCONNECTERRORMSG="Failed executing pre-vpn-disconnect action." 
For a complete list of settings and the corresponding default values, see Customizable App Settings.