Advanced Automation in NinjaOne: Auto-Install Applications

NinjaOne Auto-Install Application Blog Banner

This blog post is a companion piece to our Advanced Automation in NinjaOne webinar, providing step-by-step instructions for setting up the Auto-Install Applications example explored during that webinar. The full webinar recording provides additional examples, tips, and suggestions for getting more out of NinjaOne’s automation capabilities.

This blog post and webinar recording should ideally be read and watched together. To follow along, click here to jump ahead to an in-depth explanation of the NinjaOne auto-install example, or you can view the entire recording below.

What we’ll accomplish with NinjaOne automation

In this walkthrough, we’ll create a reusable form (via custom fields) to automate the deployment of multiple applications (via scripts) and use policies to automatically fill out that form, detect the form fill, and deploy the scripts making application deployment fully automated.

NinjaOne automation allows for custom software deployment profiles delivered at scale via policy assignment. Learn how to streamline your deployment process and optimize IT efficiency with the Software Deployment User Guide.

Top 10 IT tasks to automate
See how to automate 10 common IT tasks.

Setup custom fields

We’ll need several custom fields for this automation — a master deployment switch and a checkbox for each application we want to deploy. In this example, we’re creating switches for Malwarebytes, Bitdefender Gravityzone, Google Chrome and Mozilla Firefox; the portfolio of applications you make available for deployment can easily be changed and expanded.

When the master deployment switch is enabled (set to ‘true’), the policy will deploy each application whose checkbox is checked (set to ‘true’).

Custom Fields

To set up custom fields, navigate to ‘Configuration’ -> ‘Devices’ -> ‘Global Custom Fields.’ These custom fields can also be set up as role custom fields if they only apply to specific device types (Windows laptops only, for example).

All custom fields should be set to ‘Read / Write’ via scripts. All the custom fields in this example are checkboxes.

Field Name Type Purpose
Application Commit Checkbox Stops automation from running until set to ‘true’
Malwarebytes Checkbox Indicates if MalwareBytes should be installed
Bitdefender GravityZone Checkbox Indicates if Bitdefender should be installed
Google Chrome Checkbox Indicates if Chrome should be installed
Mozilla Firefox Checkbox Indicates if Firefox should be installed

This is what the form will look like on an endpoint:

If you’re following along with the webinar recording, we also use an organization-level custom field called ‘Package ID’ to ensure the successful installation of GravityZone.

Setup scripts

For this automation, we’ll need:

  • Checkbox Field Management – a dynamic script that will dynamically uncheck or check a checkbox.
param(
    $fieldname,
    $fieldvalue
)
Ninja-Property-Set $fieldname $fieldvalue

This script allows you to check or uncheck a checkbox by entering the field name and field value when configuring the script to run.
For example, running this with the parameters below would set the Malwarebytes field to true.

$fieldname = Malwarebytes
$fieldvalue = 1

  • Application Deployment: a script for each application we want to deploy. You can use the built-in application deployment script or write your custom script for more complex application deployments. Note that applications should be installed silently.

Bringing it all together via policies

In this example, policies will serve two functions:

  1. To detect when an application deployment checkbox is checked and deploy the appropriate application
  2. To set specific checkboxes when a device is first onboarded

Detect and deploy

The checkbox state detection and application deployment trigger will be done via conditions.

We’ll need to set one of these up for each application we deploy. We’ll use Google Chrome in this example:

  1. Add a new condition with a condition type of ‘custom field.’
  2. Under ‘Custom field value must meet all conditions,’ select the ‘Google Chrome’ custom field, set the operator to ‘equal,’ and check the checkbox
  3. Add a second field under ‘Custom field value must meet all conditions’ select ‘Application Commit’ custom field, set the operator to ‘equal,’ and check the checkbox.
  4. Hit ‘Apply’

When this monitor is triggered, we’re going to want to deploy Google Chrome so that we can add an install application script.

  1. Click ‘Add Script’
  2. Click ‘Install Application’
  3. Follow the install application prompt

We also don’t want Ninja to try to install Chrome continuously, so we’re going to uncheck the Google Chrome custom field by also deploying the Checkbox Field Management script from earlier.

Automating the application deployment profile

This last step is purely optional but adds a lot of value to this automation. In short, the more applications you setup in this manner and the more application deployment profiles you can automate, the better.

At this point, your technicians can manually check the boxes on a device and deploy software. This step will automatically assign application deployment profiles to devices when added to a policy.

We’ll use scheduled scripts to automatically check the checkboxes for specific applications whenever a new device is added to this policy. For this example, we’ll automatically deploy GravityZone and Chrome when a device is added to the policy.

  1. Navigate to ‘Scheduled Scripts’ in your policy and click ‘Add a scheduled script.’
  2. Give the script a name (‘Application Deployment Profile’ for example)
  3. Set the schedule to ‘Run once immediately’ — this will run the script as soon as the device checks in for the first time
  4. Add a script and choose ‘Checkbox Field Management.’
  5. Set the parameters to ‘bitdefenderGravityzone true.’
  6. Hit ‘Apply’ and ‘Save’

You’ll need to repeat the process for Chrome and the application commit checkbox process, with the only difference being the parameters set to ‘chrome true’ and ‘applicationCommit true.’

Once you hit save, this application deployment profile will run.

See how GSDSolutions was able to streamline their workflow and make their technicians more efficient.

“Ninja does a lot of work for us – from software deployment and patching to basic remediation – giving my technicians time to work on complex tasks for clients,”

Mark Andres, Director of IT Services at GSDSolutions

Deploying in the real world

This example uses a limited number of applications and only a single application deployment profile. In a real-world scenario, the number of applications would likely be much higher. Additionally, if we have only one application deployment profile, the need for conditional deployment is minimal, and there are easier ways to accomplish this.

A better deployment scenario might leverage policy inheritance and multiple sub-policies to assign applications based on employee function and/or client needs.

  • Parent Policy – all the application deployment monitors are set up here. No scheduled script is assigned for an application deployment profile.
    • Marketing Child Policy – Uses a scheduled script to create an application deployment policy that installs common applications, Photoshop, and video editing software.
    • Engineering Child Policy – Uses a scheduled script to create an application deployment policy that installs common applications, Nodepad++, and a VPN to your production environment.
    • Finance Child Policy – Uses a scheduled script to create an application deployment policy that installs common applications and accounting software.

Next Steps

Supercharge your IT with NinjaOne’s scalable software deployment tool. Deploy, patch, uninstall, and monitor applications seamlessly, bypassing the need for traditional networks, VPNs, or domains. Experience unrivaled IT efficiency and break free from limitations with NinjaOne.

Learn more about NinjaOne Software Deployment, check out a live tour, or start your free trial of the NinjaOne platform.

 

 

You might also like

Ready to become an IT Ninja?

Learn how NinjaOne can help you simplify IT operations.

×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).