Category Filter

Sample Script Repository

With Hexnode UEM, you may remotely execute scripts on devices running macOS 10.11 and above. This document equips you with a collection of shell scripts that Mac admins may find useful in their workflows. Echo command

The echo command writes arguments to the standard output. When you manually run the script on the Mac […]

Script to remotely enable or disable Firewall on your Mac endpoints.

The command-line installation of the Cisco Roaming client enables you to customize its behavior/appearance during the installation process. For example, you can use various custom parameters to redesign the single/standalone deployment of the Umbrella roaming client on Mac. However, when you want to deploy the Umbrella roaming client or modify its installation on numerous Mac […]

The script enables you to modify the date and time on a fleet of devices without direct user interactions.

The script helps to remotely shut down macOS devices along with providing granular control and automation over the shut down power option.

Run this script to remotely configure sleep settings such as display timeout period and scheduling sleep/wake-up events on macOS devices.

Execute this shell script to remotely open apps on your macOS devices by specifying the app name or identifier.

Script to force close an unresponsive app and all its running processes on a macOS device.

Script to uninstall applications and remove all associated app files from your macOS device.

To create a folder on a Mac, the user will have to navigate to the location on the Finder application and click on the context menu option to create a new folder on the location. The user may then rename the folder manually. To create a file, they may have to follow more sophisticated methods. […]

To open a file or folder on a Mac, the user will have to navigate to the location on the Finder application and click on the file or use the context menu ‘Open With’ option to open the file with the relevant application. This method is tedious for the device administrator when managing multiple endpoints […]

To copy a file or folder to another location on a Mac, the user will first have to navigate to the location on the Finder application and use the context menu option ‘Copy’ or press command + C to copy the file. Then, they have to open the target location and use the context menu […]

To move a file or folder to another location on a Mac, the user will first have to navigate to the location on the Finder application and use the context menu ‘Copy’ option or press command + X to cut the file. Then, they have to open the target location and use the context menu […]

To delete a file or directory on a Mac, the user will have to manually navigate to the location on the Finder application and use the context menu ‘Move to Trash’ option to delete the file. This method is tedious for the device administrator when managing multiple endpoints and impractical when deleting multiple files or […]

If a user on Mac has the admin role, they can create a new user easily from System Preferences > Users & Groups. But, when a device admin managing a large number of macOS endpoints desires to create a new account this way, it becomes a tedious process to do it manually on each endpoint. […]

Remotely fetch the list of all users and their details from macOS devices by running this script from Hexnode UEM.

Want to change the user passwords on your Mac endpoints? Run this bash script using Hexnode’s Execute Custom Script action to remotely modify the login password associated with any user account on a Mac.

Being the IT administrator of a school or business organization, you might have requirements where you need to hide or disable the Profiles pane from System Preferences on your Mac endpoints. This way, you can prevent users from tampering with the installed profiles and avoid making any configuration errors on the devices. With Hexnode’s Execute […]

Apple releases OS updates periodically to fix bugs or strengthen the security of the released versions of the OS. Organizations prefer their devices to have the latest available OS. However, deploying OS updates can be a cumbersome task for the IT department of any organization because of the sheer number of devices. Hexnode provides three […]

Script to set the time zone of macOS devices over the air seamlessly.

A proxy server is a system or router that acts as a gateway between end-users and the internet. The proxy has its own IP address, which masks the end-users IP address and provides an extra layer of security when browsing the internet. Apple provides six different proxy configurations in Mac. Using Hexnode UEM, you can […]

Using Hexnode, the admin can deploy a script to copy a given text to the clipboard of the target systems. Once the text is copied, the user can paste it multiple times at different places. The text will be stored in the clipboard till another text is copied. Scripting Language – Bash File extension – […]

Device admins can set wallpapers remotely for endpoint devices by running a script with Hexnode’s Execute Remote Script action for Mac. The following instructions will help you prepare the script that locates an image on the endpoint and sets it as the desktop wallpaper for the specified user. The script can be saved as a […]

A Mac device can be identified using the computer name or the local hostname. A Mac’s computer name is displayed on top of the Sharing preferences pane, and the local hostname is displayed right below the computer name. By default, the local hostname of your device is your computer name with “.local” added to the […]

Filevault encryption protects sensitive corporate info against data breaches. You can ensure data encryption is active on workplace Macs and fetch its status with Hexnode's Execute Custom Script action.

Administrative privileges are necessary for making system-wide changes like adding/managing users, adding/deleting programs etc. Using the following scripts, you can revoke or grant admin rights to a user through Hexnode. Revoking admin rights of an account

Giving admin rights to a standard account

Give admin rights to a standard account for 30 minutes […]

Turning off Wi-Fi when not in use reduces energy consumption and increases the battery life of macOS devices. Hexnode lets admins deploy scripts to switch off Wi-Fi on macOS devices. Turn Off Wi-Fi Script to turn off Wi-Fi on macOS devices:

Bash script to install fonts to Font Book in macOS devices saves you the time-consuming process of making a particular font available to each user.

Bash script to fetch the login history of all the users that have been logged in to your macOS devices in the past few days and to check the last logged-in time of a particular user.

Bash script to check the Bluetooth power state and turn it on/off without involving direct user interaction in macOS devices.

Enabling/Disabling Automatic updates in App Store requires the user to manually configure the required option in Advanced Settings under System Preferences > Software Update. However, this action becomes more difficult as the number of devices increases. In such situations, the Execute Custom Script action in the Hexnode portal can be utilized, where you can run […]

Apple devices are known for their extensive security and privacy features. Apple does not allow users to remove the login password from their Macs as it could potentially risk any personal or confidential data if the device gets stolen or lost. However, you will be able to set an empty string as the login password […]

Strong passwords ensure protection against unauthorized access to your macOS devices. Administrators can remotely set the Mac to require a password when it wakes from sleep with the help of scripts in Hexnode. Enabling a password will keep the data on the Mac secure when users are away from it. Hexnode helps admins perform this […]

To set up a Wi-Fi network on Mac, users have to manually configure the Wi-Fi network under System Preferences. Configuring a single device may seem effortless; however, setting up Wi-Fi for multiple devices can be a tedious process. To overcome this obstacle, you can execute custom scripts remotely on endpoints using Hexnode UEM. This enables […]

Enforcing password policies is an effective technique to ensure that your employees have secure passwords and update them regularly. Hexnode provides two methods to enforce password policies on macOS devices; configuring Passcode rules via policies and by deploying scripts. If your company has decided that the MDM Passcode payload isn’t suitable or desirable, the Execute […]

The remote ring feature has become very useful, especially for enterprises with a large number of devices to locate any misplaced device nearby. By executing custom scripts in Hexnode, you can activate the remote ring feature on Mac. Script for remote ring

MAX_SECONDS sets the maximum time (in seconds) for the device to ring. […]

When employees leave an organization, the corporate devices assigned to them are re-distributed to other workers in the firm. Hence, organizations may require to delete the data and user account from the devices. However, manually doing this task is a time-consuming process. Hexnode lets you deploy scripts to delete the user account from Mac devices. […]

Users can change the brightness levels on macOS devices with the help of dedicated function keys or using the System Preferences. Despite these alternatives, administrators can directly run the Terminal commands to adjust brightness on Mac. Hexnode enables you to run these commands as scripts remotely using the Execute Custom Script action. Change brightness


Organizations consider Google Chrome a necessary utility that improves users’ browsing experience. However, as an administrator, if you want to exert more control over the Chrome browser and determine the extensions installed on the macOS devices, you can get it done quickly with the help of scripts. The Execute Custom Script action enables you to […]

The login window has several settings, including selecting the user login and power options like shutdown, restart, and sleep. Organizations may need to hide the user list or disable the power options on the login page to ensure enterprises’ security. You can remotely execute custom scripts to customize the login window on macOS devices. Scripting […]

AirDrop functionality lets users transfer files between nearby Apple devices. However, if you want to restrict file transfers via AirDrop in your corporate environment, you can restrict the AirDrop functionality. By executing dedicated terminal commands, you can disable or re-enable AirDrop whenever necessary. The Execute Custom Scripts action lets you remotely run these commands on […]

Script to modify and manage time machine configurations to automatically backup the data of your macOS devices.

Easily create new users on Macs by deploying this script to the devices from the Hexnode portal.

Have you ever wondered how big a specific file or folder on a Mac is? You can view the file or folder size using the Get Info option by right-clicking on the required file or folder on a Mac. However, manually checking the file or folder size on multiple endpoints may be tiresome for the […]

Every file or folder on Mac has an owner account assigned to it. Users can assign ownership of a file or folder to a specified user using the Get Info option. Right-click on the target file or folder to access the Get Info option from the dropdown menu. When configuring multiple endpoints, changing the file […]

In macOS devices, the Finder application is used to view and configure all files and folders on the system. The Finder application provides a great graphical user interface to interact with files on the system. What if device administrators need to remotely view all files in a folder. The solution is to run custom scripts […]

Files can accumulate on the device after a significant period of use, making it difficult to find the correct location of a specific file or folder. On a Mac, the user can view the full location path of the target file by right-clicking on the file and clicking the Get Info option. With a large […]

Secure Erase Free Space in Disk Utility was an important feature on Mac. It added a layer of security and privacy with respect to file deletion. However, to prevent the users from recovering the deleted files, they could overwrite the free space on the drive. This feature is no longer available on modern versions of […]

Guest User on macOS devices provides a way for unauthorized users to use your device without handing them access to your private data and digital workspace. To configure the guest user account on a Mac, users have to manually enable the Guest User option under System Preferences. With Hexnode UEM, you can remotely enable the […]

Execute a Bash script to remotely monitor the battery status of macOS devices.

Run a simple Bash script to remotely execute Disk Utility operations on macOS devices.

Remotely execute a simple Bash script to list all the applications running in the foreground on macOS devices.

Remotely create a sharing-only user account on the macOS devices by executing a Bash script.

Remotely retrieve all the required system information by executing a bash script on macOS devices.

Admins can remotely inspect the disk usage on end-user devices by utilizing Hexnode’s custom script functionality.

Configure printer settings to deploy and remove network printers using bash script in macOS devices.

Bash Script to easily track down and identify the apps and processes connected to the internet in macOS devices.

Script to lock and unlock files on your macOS devices to prevent and enable file modification using the chflags utility.

Permit and deny access to specific websites or URLs on the macOS devices using custom scripts.

Schedule a periodic restart at the specified time on macOS devices using a bash script.

Script to hide or disable the different panes in System Preferences on your macOS devices.

Bash script to enable and disable Notification Center for the currently logged-in user on macOS devices.

Admins can remotely customize Dock preferences for multiple endpoints by executing a custom Bash script through Hexnode UEM.

Enable Remote Management in Macs and let remote users manage the device with the help of the Apple Remote Desktop with Hexnode’s Execute Custom Script action.

Fetch a list of admin user accounts and remotely check if a particular user has admin access by executing scripts using Hexnode's Execute Custom Script action.

Oh Sorry!, nothing matched with your search terms. Please try again with some different keywords.

You can run PowerShell scripts to carry out a wide range of administrative tasks on your Windows endpoints. For example, executing this PowerShell script can remotely unlock your Windows PC so that the device end-user can automatically sign in to the device without entering any credentials. That’ll be useful for users when in a trusted […]

You can execute custom scripts on Windows 10 running version 1703+, enrolled in Hexnode using the Hexnode Installer App. Hexnode supports .bat, .cmd, .ps1 script formats. Here are some sample code snippets for the most commonly executed tasks in Windows that you might find useful: Serial No Script 1 Turn on Firewall 2 Add Windows […]

Windows Firewall is a security mechanism that protects the device from unauthorized access. It helps secure the endpoints and permits you to create network rules for regulating network traffic. This doc assists you on how to configure firewall settings and rules using scripts via Hexnode UEM. Setting up Windows Firewall using scripts You can use […]

Adding Windows devices to an Active Directory domain is no more a hassle. You can get it done quickly by creating PowerShell scripts to be executed from the Hexnode portal. It adds the device to the specified domain without requiring direct access to the device. PowerShell script to add a Windows device to the domain […]

A user belonging to the ‘Administrators’ group has complete and unrestricted access to the device. Suppose you want to revoke the administrator privileges of a user to prevent them from making system-wide changes. You can easily get it done by writing commands to remove the users from the ‘Administrators’ group and add them to the […]

Some restrictions might only take place after the device restarts. The admin can use the remote action Restart Device or deploy scripts to achieve this. Batch Script

Powershell Script

The admin might need to shut down devices remotely. Hexnode allows admins to shut down Windows 10 devices by deploying scripts. The admin can delay the action according to their wish. This document contains the code snippets for shutting down the device. Batch Script

Powershell Script

Enterprise apps are apps that are tailored to meet the needs of an organization. Hexnode users can deploy scripts to download and install such apps on Windows 10 devices. Batch Script

E.g., To install a program abc.exe in the Desktop of the user Deborah, bitsadmin.exe /transfer “abctransfer” http://download.url/abc.exe C:\Users\Deborah\abc.exe Start C:\Users\Deborah\abc.exe Powershell Script


Windows 10 comes with a set of pre-installed apps. However, not all apps might be useful in an organization. Using Hexnode, the administrators can deploy scripts to uninstall Windows store apps. Batch Script

E.g., To remove the app Notepad saved in C drive, msiexec /x “C:\TEMP\XmlNotepad.msi” /qn Powershell Script

E.g., To remove the […]

Administrators might have to remove custom apps once their purpose is served or if they become outdated. They can deploy scripts via Hexnode to uninstall such enterprise apps. Batch Script To uninstall .msi and .exe files,

E.g., To remove the enterprise app 7-Zip, wmic product where “name like “’7%%'” call uninstall/nointeractive Powershell Script To […]

Some corporate devices might be used by more than one employee. As a result, an administrator might have to create separate user accounts on each device. Manually creating accounts on all the devices is a tedious task. Hexnode lets admins deploy scripts to get the job done. Batch Script Create user

E.g., To create […]

User Management on Windows 10 devices becomes easier when the users are grouped. Hexnode lets admins deploy scripts to group users on multiple devices simultaneously. Batch Script

E.g., To add the user Josh to the group of Users, net localgroup Users Josh /add Powershell Script

E.g., To add the user Josh to the […]

Users forgetting their device password is a common scenario for an IT admin. Hexnode lets admins to change the password of users by deploying scripts. Batch Script

E.g., To edit the password of the user, Josh to abc_123, Net user josh abc_123 Powershell Script

E.g., To edit the password of user, Josh to […]

Management of files becomes easier if they are named sensibly. Hexnode lets admins to rename files on multiple devices simultaneously using scripts. Batch Script

E.g., To rename the file test.txt in the Desktop of the user Deborah to testing.txt, cd C:\Users\Deborah\Desktop ren test.txt testing.txt Powershell Script

E.g., To rename the file test.txt in […]

When the number of files/folders in an organization increases, the administrators might need to delete outdated files. With more and more machines getting remote, admins find this task increasingly difficult. Hexnode lets admins handle this action via scripts on Windows devices. To delete a file Batch Script

E.g., To delete the file test.txt in […]

Administrators need to keep tab on users accounts in their corporate devices for effective user management. Hexnode users can deploy scripts to get the details of all the users on a Windows 10 device. Batch Script

Powershell Script

It is imperative to download and install OS updates released by Microsoft as these updates might fix bugs and security flaws in your system. Using Hexnode, you can deploy scripts and effortlessly update the Windows devices to latest version. Batch Script

The usoclient.exe commands do not provide any feedback on the terminal when executed […]

Once a particular text is copied to the clipboard, the user can paste it multiple times at different places. The administrator can use Hexnode to deploy a script to store a given text on the clipboard of Windows 10 devices. The clipboard will hold the value till another text is copied. Batch Script

E.g. […]

You can use custom scripts to perform almost all sorts of configurations on the devices. For example, when you want to pre-provision Windows devices with necessary files, you may use PowerShell commands to specify the file URL to download them directly to a specified location on the devices. These commands can be executed as scripts […]

Administrators might want to monitor the Wi-Fi networks that their corporate devices connect to. It helps them ensure that the devices only connect to safe Wi-Fi networks. Hexnode lets admins deploy scripts to get a list of previously connected Wi-Fi networks. Fetch the list of previously connected Wi-Fi networks When the device is connected to […]

Searching for specific files on a device can be tedious and time consuming for users. If searching for and finding files are made easy, managing data becomes easier. Hexnode lets admins find files on devices with specific extensions using scripts . Find files using batch script

This command lists all files with .txt extension […]

Users tend to forget their passwords from time to time. The process of individually removing/resetting passwords for users puts IT departments in a difficult situation. Fortunately, Hexnode provides a viable solution, enabling users to remove/reset their passwords by executing custom scripts. Batch script Reset the password for the local computer

This command resets the […]

Many organizations require printers for their daily works. Manually adding printers to employees’ devices is a tedious task. The installation and configuration procedure can be automated to save time and make the process easier. You can add printers on Windows 10 devices remotely by executing custom scripts via Hexnode. Batch Script To add a network […]

Windows Audio Service manages all the audio devices on your computer. It is a vital component to enable sound for any program running on the Windows operating system. By default, the audio service starts when you power on your device. But there may occur times when the audio service glitches and stops working. Executing a […]

Organizations may need to delete expired certificates and replace them with new ones to ensure proper functioning of the organization. Manually deleting certificates on many devices will be a tedious task. Hexnode UEM allows you to delete certificates on Windows devices remotely by executing Custom Scripts Batch Script To delete a certificate from LocalMachine, use […]

Windows 10 has a plethora of ways to back up and restore your data – File History, System Image Recovery, System Restore, just to name a few. However, if you’re someone who wants to doubly secure their data backups just to be on the safe side, you can also achieve the same by executing a […]

A user belonging to the ‘Users’ group does not have complete access to the device. Suppose you want to enable the administrator privileges to a user. You can easily get it done by writing commands to remove the users from the ‘Users’ group and add them to the ‘Administrators’ group. These commands can be embedded […]

Ping is a command-line utility that checks if an IP address or host is accessible over a network connection. To check the accessibility of a website, the Ping command sends data packets to the target address and waits for the response. A successful ping is registered if the data packets are returned without damage. IT […]

This article will tell you how to deploy scripts to find the login information of the last logged-in user on your Windows device. Many organizations have devices that are being used by multiple users. As an organization, have you ever wanted to monitor who’s logging into your Windows device and when? Monitoring and managing these […]

Website blacklisting is a defense mechanism that prevents users from accessing harmful and unwanted web URLs. With whitelisting, the users can access only the permitted websites on the device. The browser prompts a blocked access notification when the users access the blacklisted or non-whitelisted websites. Depending on the enterprise requirements those websites necessary for the […]

It is simple to create a file or folder on a device. However, creating files and folders on a large number of devices in a specified location becomes a time-consuming task. Hence, you can simplify this process on Windows devices by deploying custom scripts from Hexnode. Create Files Batch Script

Create a file after […]

A system admin might need to create new folders on employee devices to keep things organized. Doing this manually on each device would be a hassle, especially if the company has numerous endpoints deployed across the globe. This doc assists you on how to remotely create a new folder on Windows 10 devices if it […]

Encryption is one of the fundamental ways of protecting the data stored on the devices. Most organizations prefer device encryption using BitLocker to prevent unauthorized access to corporate data on Windows 10 devices. Yet, if you need to verify the encryption status of the devices, you can get it done with the help of terminal […]

Managing files and folders on devices becomes easier if they are sorted and easily retrievable. Hexnode UEM allows you to view and list all files and folders on Windows devices using custom scripting feature. PowerShell Commands 1. List of Files and folders

The Get-ChildItem returns a list of all files/folders present in the specified […]

Deploying trusted CA certificates to the devices in a work environment is crucial since certificates enable streamlined access to various services. They act as credentials, authenticate clients, perform encryption/decryption and can also be used to sign messages digitally. Though the uses may vary, organizations might be looking out for possible ways to install them without […]

A screensaver is set to turn on after a period of inactivity of the user. It is important to protect your devices when unattended as it is vulnerable to potential intruders. A screensaver prevents someone from viewing your personal files and can also be used as a medium to display your brand when idle. You […]

Management becomes easier when data is stored systematically and can be retrieved easily. Most corporate devices contain sensitive data that need to be moved to secure locations frequently to prevent a data breach. Doing it manually might seem like the only option. But with Hexnode UEM, administrators can use custom scripts to copy files and […]

Saving too many files on your desktop may slow down the system and make it harder to organize files. In addition, files on the desktop are not as secure as the files in libraries like ‘My Documents’ when you use System Restore or run file-based backup programs. Therefore, it is recommended to create shortcuts on […]

Clearing all caches in Windows usually helps a lot if your device is slowing down or exhibiting suboptimal performance. This usually happens when you’ve been on the internet for a while, installed Windows updates, or haven’t reset your computer in a long time. For a variety of reasons, clearing your cache on a regular basis […]

Windows device logs are detailed records of events in the operating system or the installed applications. As a system administrator, you can analyze these logs to troubleshoot any particular issue that occurs on the device. With Hexnode’s Execute Custom Script action, you can push custom scripts to remotely fetch the device logs on your Windows […]

Hexnode UEM automates the execution of proactive IT tasks on Windows 10 with the help of custom scripts. For example, you can create Batch file scripts or PowerShell scripts to perform necessary operations, which can be executed on the devices remotely from the Hexnode console. This doc helps you create custom scripts to change the […]

Employees in an organization may use their company-owned devices for non-work-related purposes. Admins can inspect employees browsing histories to understand what they have surfed on the internet with their corporate devices. However, manually checking the browsing history on every device is tiresome. Hence, you can deploy scripts from the Hexnode portal to fetch browsing history […]

A screensaver is set to turn on after a period of inactivity of the user. It can be used as a medium to display your brand when the screen is idle. It is also used to prevent others from viewing personal content when the user is away for a short while. You can set a […]

In institutions such as hotels, hospitals, and schools, the devices may be shared among multiple users. In such instances, other users may gain access to the users’ internet surfing history. Hence, organizations may require to delete the browsing history from the devices to protect the privacy of each user. However, manually clearing browsing history from […]

Cisco Umbrella is a cloud-based security service that provides a wide range of security functions in a single platform. With the help of the Umbrella roaming client, enterprises can extend its protection to all users even outside the corporate network. Cisco Umbrella offers command-line installation of the roaming client on Windows devices and allows customization […]

As an IT administrator of an organization, you might have numerous reasons to gather various device information about your Windows endpoints. For example, you might need specific info regarding the system for troubleshooting or to check the feasibility of running a software application. There are multiple ways to achieve this: Using the System Information tool […]

The script helps administrators to set up specific time zone on Windows devices remotely.

Oh Sorry!, nothing matched with your search terms. Please try again with some different keywords.