Favicon

You are here: Home > Device Management > Windows > Get Started > Scripts

How to Create and Assign Scripts to Devices

Create and assign Scripts to Windows Devices using Applivery for automated task management and IT process efficiency.

5 min read

TL;DR

Learn to automate device management tasks by creating and assigning scripts using Applivery, enhancing efficiency and reducing manual effort.

A computer script is essentially a sequence of instructions (commands) that the computer executes, making it an excellent tool for automating repetitive tasks. Scripts are highly scalable and versatile.

Because scripts can be deployed to user Devices through device management solutions (such as Applivery), they are invaluable for IT teams. They enable you to perform complex tasks quickly, accurately, and effortlessly:

  • Quickly: By using scripts alongside mobile device management, you can automate tedious processes. For example, you can access a computer program on 100 company Devices with zero clicks instead of doing it manually 100 times.

  • Accurately: A well-written script will consistently execute the same defined action every time, reducing the risk of errors that might occur if a human administrator were to perform the task manually, which can lead to inconsistencies and confusion.

  • Easily: You can achieve complex and detailed tasks by breaking them down into smaller, manageable scripts, making the overall process much simpler.

1
Create your first script

Go to the Applivery Dashboard and navigate to Resources 1, then navigate to the Scripts 2 section and click on + Create Script 2.

scripts

A code editor will appear on the screen.

Within the editor, you can either create a new script or upload an existing one from your Device, allowing you to easily tailor scripts to your needs.

To create a new script, use the editor interface and start typing. First, select the desired language—PowerShell 4 in this case.

To upload an existing script, click Load from file 5, select your script, and it will be ready to use.

Finally, provide a Name 6 (and optionally a description), then click Create 7.

create script
Note

If you need help creating a script, you can also use our AI Assistant. Just click the corresponding button, and a dialog box will appear where you can describe the script you need. Our assistant will then generate it for you.

Warning

Note that the AI Assistant is a premium feature that might not be available in your current plan. Check the availability on our pricing page.

2
Assign Scripts to your Devices

Now, navigate to the Devices 8 section, choose the Device to which you want to assign a script, go to the Scripts 9 tab, and click on the + Assign Script 10 button.

assign script

A modal view will appear, allowing you to choose a script from the script section or upload it from your Device.

You will also have the option to select the execution method and add the script’s arguments:

  • Once: The script will run once per device. You will also have the option to repeat the execution, even if it has already been executed.

  • Loop: The script will run cyclically at the chosen time interval.

  • On-demand: The script will never be run automatically and will only be offered as an optional item from Self-Service.

script form

By clicking the Execution history 11 button, you can view the execution history of all your scripts.

You can also access the execution history of a specific script by clicking on the script itself or the three vertical dots at the end of the script. Clicking these dots will also display additional actions:

  • Edit: Edit the script.

  • Unassign: Unassign the script from the Device.

  • View: View the original script in the asset section.

Warning

For scripts with the Once execution method, you will also see the Repeat execution option. In addition to allowing a script to be retried after a failure, this option also determines whether a script with the same ID can be executed again on a Device where it has already run, even if that execution took place in the past.

This ensures that the script will be sent again, regardless of its prior execution history on that Device.

script options
Tip

You can also assign scripts to Policies, ensuring they apply to all Devices under the same policy. To do this, navigate to the Policies section, select the desired policy, and click on the Scripts tab. The process will be the same as when assigning it directly to an individual device.

Script arguments

When assigning a script, the Arguments field lets you pass parameters to your script at execution time. Applivery splits the field by whitespace, so every space-separated value is treated as a separate parameter.

Multi-word parameters

If a parameter contains spaces, wrap it in double quotes so Applivery treats it as a single value:

--label “My Application”

Without the quotes, My and Application would be passed as two separate parameters instead of one.

Interpolated variables

Applivery supports mustache-style variables that are replaced at execution time with real device or user data. Because a variable can expand to a value that contains spaces, always wrap interpolated variables in double quotes when you need them treated as a single parameter:

“{{user.name}}”

If {{user.name}} resolves to John Doe, the quotes ensure it is passed as one parameter instead of two. Without them, John and Doe would reach your script as separate arguments.

The following variables are available:

Variable Resolves to
{{device.id}} Unique device identifier
{{device.displayName}} Device display name
{{device.serialNumber}} Device serial number
{{device.osVersion}} Operating system version
{{device.chip}} Processor/chip type
{{device.hostName}} Device hostname
{{user.id}} Unique identifier of the assigned user
{{user.email}} Email address of the assigned user
{{user.name}} Full name of the assigned user

Escaping special characters

To include a special character literally in an argument, prefix it with a backslash (\). This is useful when passing values like Windows paths or strings that contain double quotes:

C:\\Program Files\\MyApp

This passes C:\Program Files\MyApp as the argument value. To include a literal double quote inside a quoted parameter:

“He said \”hello\””

Do It Yourself!

To help administrators accelerate common configurations and operational tasks, Applivery provides a Public Script Repository containing ready-to-use Windows scripts.

This repository includes useful scripts for quick actions and standard configurations, allowing IT teams to deploy common solutions without having to build scripts from scratch.

The goal of this initiative is not only to provide reusable resources, but also to encourage collaboration. The community can actively contribute by submitting scripts that address real-world use cases, helping expand and improve the shared library over time.

By leveraging the Public Script Repository, organizations can reduce implementation time, standardize operational procedures, and benefit from collective expertise.

Key Takeaways

  • Scripts automate repetitive tasks, improving efficiency and accuracy.
  • Applivery provides a user-friendly interface for creating and assigning scripts.
  • Scripts can be assigned to individual devices or policies.
  • Different execution methods (Once, Loop, On-demand) cater to various automation needs.
  • The Public Script Repository offers pre-built scripts for common tasks.

Scripts automate repetitive tasks, allowing IT teams to perform complex actions quickly, accurately, and easily across user devices via device management solutions like Applivery.

Go to the Applivery Dashboard, navigate to Resources > Scripts, and click "+ Create Script". You can then type your script, select a language like PowerShell, or upload an existing file.

Yes, Applivery offers an AI Assistant that can generate scripts based on your description. This is a premium feature, so check your plan's availability.

Navigate to the Devices section, select a device, go to the Scripts tab, and click "+ Assign Script". You can choose a script, its execution method, and add arguments.

Scripts can be executed "Once" (single run), "Loop" (cyclically at intervals), or "On-demand" (manual execution from Self-Service).

Use the "Arguments" field when assigning a script. Separate values by whitespace, wrap multi-word parameters in double quotes, and use `"{{variable}}"` for interpolated data.

Yes, Applivery provides a Public Script Repository on GitHub with ready-to-use Windows scripts. This repository also encourages community contributions for common configurations and tasks.

Last updated: June 9, 2026