# Script to enable Remote Management on Mac

Remote Management in Mac lets remote users manage the device with the help of Apple Remote Desktop. It permits those users who have predefined access to the device to manage the system, interact with users, configure preferences, deploy files, etc., with Remote Desktop. First, however, you should enable remote management from the **System Preferences (System Preferences > Sharing > Remote Management)** of a client macOS device to manage it. Hexnode makes this task simpler with the [**Execute Custom Script**](https://www.hexnode.com/mobile-device-management/help/how-to-run-scripts-on-mac-using-hexnode-mdm/) action, where you can enable remote management by executing customized scripts.

 Disclaimer:The Sample Scripts provided below are adapted from third-party Open-Source sites.

 

 Scripts to activate and deactivate Remote Management 
------------------------------------------------------

To activate Remote Management,

Script to activate Remote Management

\#!/bin/sh /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate 

   1

2

3

  \#!/bin/sh 

/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate 

   

 

  

To deactivate Remote Management,

Script to deactivate Remote Management

\#!/bin/sh sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate 

   1

2

3

  \#!/bin/sh 

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate 

   

 

  

`Kickstart`– allows you to install, uninstall, activate, configure, and restart components of the ARD agent app without restarting the computer.

`ARDAgent.app`– is an icon-less, windowless app installed by default on a Mac that responds to Remote Desktop apps’ remote administration requests.

By default, Remote Management may be accessed by all users when enabled. To activate Remote Management for specified users, run the command:

Script to activate Remote Management for specified users

\#!/bin/sh sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -specifiedUsers 

   1

2

3

  \#!/bin/sh 

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -specifiedUsers 

   

 

  

 Notes:- It is recommended to manually validate the script execution on a system before executing the action in bulk.
- Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.