Deploying via Startup/Shutdown script

Updated 2 months ago by admin

If you are migrating from Cloud Link to USS Agent, please ensure that Cloud Link is completely uninstalled before installing USS Agent. Resources on uninstalling Cloud Link can be found at http://help.cloudwebfiltering.com.

To achieve an unattended install and uninstall of USS Agent, you can use the Startup/Shutdown Script functionality of Windows domain controllers. For simplicity, this article will show you how to edit the Startup/Shutdown script settings for the Default Domain Policy which is applied to all computers in the domain. You may want to select a different group policy to suit your needs.

Open the Group Policy Management snap-in

Expand your domain and then click on the Default Domain Policy GPO

Right click and select Edit... and the Group Policy Management Editor snap-in will appear.

Navigate to Computer Configuration then Policies then Windows Settings and click on Scripts.

In the right-hand pane you will see Startup and Shutdown listed:

You can now configure either a startup script or a shutdown script.

Installation using a Startup script

Right click on the Startup option from the right hand panel in Group Policy Management Editor.

Click Properties.

Click Show Files. A window will open showing the contents of the %SYSVOL%\domain\policies folder which is where the scripts are stored on the domain controller.

Right-click anywhere in the white space and click New and then Text Document. This will create a blank file - make sure you rename this file .bat (e.g. installagent.bat)

Now right-click the newly created .bat file and click Edit.

A notepad window should open. Paste the following into the file:

Verbose, using all parameters:

msiexec.exe /i InsertUSSAgentInstallFileNameHere.msi /quiet USS_USERNAME="xxxxxxx@clouduss.com" USS_PASSWORD="xxxxxxxxxxxxxx" USS_HOSTNAME="%computername%" USS_API_DOMAIN="apiv2.clouduss.com" USS_AGENT_PROFILE_ID=123 /l*v uss_install.log

Simple, using default values for parameters:

msiexec.exe /i InsertUSSAgentInstallFileNameHere.msi /quiet USS_USERNAME="xxxxxxx@clouduss.com" USS_PASSWORD="xxxxxxxxxxxxxx" /l*v uss_install.log

For 4.1.x USS Agent installs, paste the following into the file (replacing credentials with your own and paths to the locations of files)

Verbose, using all parameters:

msiexec.exe /i Setup64.msi /quiet USS_USERNAME="user@clouduss.com" USS_PASSWORD="password" USS_API_DOMAIN="apiv2.clouduss.com" USS_HOSTNAME="%computername" /l*v uss_install.log

Simple, using default values for parameters:

msiexec.exe /i Setup64.msi /quiet USS_USERNAME="user@clouduss.com" USS_PASSWORD="password" /l*v uss_install.log

USS_USERNAME and USS_PASSWORD refers to your administrator login details for your USS Dashboard

Go back to the Properties for the Startup script and click Add and then Browse. You should be able to select the .bat file you saved above. Click Apply and then close the Properties window.

Now you should push the changes out to your domain by refreshing the group policy. This happen automatically during a restart or you can use the command gpupdate /force on the client computers.

The next time the computer starts up the script should run and install the USS Agent software.

Uninstalling using a Shutdown Script

Right click on the Shutdown option from the right-hand panel in Group Policy Management Editor.

Click Properties

Click Show Files. A window will open showing the contents of the %SYSVOL%\domain\policies folder which is where the scripts are stored.

Right-click anywhere in the space and click New and then Text Document. This will create a blank file - make sure you rename this file .bat (e.g uninstallagent.bat).

Now right-click the newly created .bat file and click Edit.

A notepad window should open. Paste the following into the file, making sure to change the UNINSTALLPASSWORD to the password of the configuration profile assigned to the USS Agent.

IF EXIST "C:\Program Files (x86)\USSAgent\USSAgent\USSService.exe" start /wait msiexec /x C:\GPOUninstall\Setup64-x.x.x.x.msi UNINSTALLPASSWORD="xxxxxxxxx" /quiet /l*v C:\uss_uninstall.log

Save the file and close Notepad.

Go back to the Properties for the Startup script and click Add and then Browse. You should be able to select the .bat file you saved above. Click Apply and then close the Properties window.

Now you should push the changes out to your domain by refreshing the group policy. This happen automatically during a restart or you can use the command gpupdate /force on the client computers.

The next time the computer starts up the script should run and install the USS Agent software

Further Resources

Assign Shutdown Scripts via Group Policy

Assign Shutdown Scripts via Local Policy


How did we do?