Apple

Pro tip: Reporting and remote command execution in Apple Remote Desktop

Jesus Vigo demonstrates how to query asset management reports and execute terminal commands remotely using Apple Remote Desktop (ARD).

Reporting and remote command execution in Apple Remote Desktop.

My personal philosophy to systems management is to "work smarter, not harder." It's been my professional mantra for almost two decades in IT, and it has served me well. In fact, it's been the driving force in pushing me to learn new ways of doing things.

What does this have to do with Apple Remote Desktop (ARD), you ask? It's simple. ARD allows one to "work smarter" by leveraging the technology, network infrastructure, and remote capabilities to execute commands on one or 1,000 nodes at the same time. This level of flexibility, combined with the scalability of ARD, allows for the management suite to grow with the enterprise.

Ultimately, as usage increases, you'll notice certain types of tasks are performed regularly — perhaps even daily — while others are only necessary when performing security auditing or planning for equipment upgrade cycles.

Follow along as we look at two features at both ends of the usage spectrum: Reporting and Remote Command execution.

I. Reports

  1. Launch Remote Desktop.app from the Applications folder.
  2. Select the computer(s) you wish to query a report on (Figure A).
    Figure A
    Figure A
  3. Click the Reports button from the taskbar (Figure B).
    Figure B
    Figure B
  4. The Reports window will open for further configuration, including but not limited to scheduling for later execution or saving as a template for future queries by clicking the Schedule... and Save buttons respectively (Figure C).
    Figure C
    Figure C
  5. The System Overview Report is just one of 14 built-in report templates in ARD. Selecting the report name will show the list from the drop-down menu (Figure D).
    Figure D
    Figure D
  6. Once a report template has been selected, further customization can be performed by drilling-down in each category. Checking specific fields will include data from that component in the report. When all desired fields have been selected, click the Get Report button to generate a report based on your settings (Figure E).
    Figure E
    Figure E
  7. Reports are generated in real time unless they're scheduled for a later date. Depending on the field's selected and online status of the computer(s), reports can take a few minutes to generate. Once completed, the categories selected in step #6 will appear as tabs within the reporting window. The All tab includes all the data culled from the devices selected in a concise, easy-to-view format (Figure F).
    Figure F
    Figure F
  8. Queried data may be exported to .TXT format by clicking the Export button and selecting a location to save the file to. Using the Field Separator drop-down, Tab or Comma separators may be used when formatting the data for importing into a 3rd-party application or database. Clicking the Save button will commit the changes and create the file (Figure G).
    Figure G
    Figure G
  9. Data may also be printed out if a hard copy is needed for record keeping. The Print button, located in the upper-left corner, will prompt to save the file as a PDF or print the document out (Figure H).
    Figure H
    Figure H

Now, let's review Remote Command execution, also known as running UNIX or terminal commands.

II. Remote commands (UNIX)

  1. Launch Remote Desktop.app from the Applications folder.
  2. Select the computer(s) you wish to query a report on (Figure I).
    Figure I
    Figure I
  3. Click the UNIX button from the taskbar (Figure J).
    Figure J
    Figure J
  4. The Send UNIX Command window will open to manually enter or select a command to send to a remote computer. Commands may be scheduled for a later time, like a maintenance window, or saved as a template for future use. Clicking the Schedule... or Save buttons performs those functions respectively (Figure K).
    Figure K
    Figure K
  5. By clicking the drop-down next to Templates, pre-configured templates for variety of management tasks may be selected for execution on remote systems. Additionally, you can edit and customize the following templates for your environment by selecting Edit Templates List: Network Setup (Figure L), System Setup (Figure M), and Miscellaneous (Figure N).
    Figure L
    Figure M

    Figure M
    Figure M

    Figure N
    Figure N
  6. For the purposes of this tutorial, I've taken the liberty of selecting a very common task from the Miscellaneous section: Download All Software Updates (Figure O).
    Figure O
    Figure O
  7. With the template selected, the accompanying command will appear in the command line window, and the Run command as: section will display the administrative user to run the command as. By default, root will be chosen, however any user account with administrative privilege may be used (Figure P).
    Figure P
    Figure P
  8. After clicking the Send button, the command will be sent across the network to the destination computer(s) and executed remotely. The status of the command execution will be visible by clicking on the task under the Active Tasks section of the navigation pane. Once completed, a confirmation report will appear with the output of the remote terminal command if the checkbox for Display all output was checked next to the Command results in step #7 (Figure Q).
    Figure Q
    Figure Q
  9. Typically, when running the command selected in step #6 above, the node will download all software updates but not install them until a later time. Another common command to execute is complimentary to the previous one chosen. Entering "software -i -a" (no quotes) and clicking the Send button will cause the computer to install all software updates currently pending installation (Figure R).
    Figure R
    Figure R
  10. While the task is in process, the status may be viewed by clicking on the task in the Active Tasks pane. Like most tasks, the time it takes to process a command successfully will vary greatly on factors such as network congestion and local resources in use on the destination stations (Figure S).
    Figure S
    Figure S
  11. Upon successful completion, the task will generate a report detailing the output from the remote terminal. These reports may be exported or printed for further review, as needed (Figure T).
    Figure T
    Figure T

ARD is a versatile solution that can provide many IT departments with a lightweight, agile means with which to manage networks of Mac computers. Interfacing with Automator, for example, ARD can fully automate the execution of repetitive administrative tasks.

Not only is ARD robust enough to scale according to the needs of the environment, but it retains all the simplicity that one has come to expect from an Apple product. It's this powerful combination that frees up the systems admin to focus on alternative projects that might require less of a personal touch — again, working smarter instead of harder.

About Jesus Vigo

Jesus Vigo is a Network Administrator by day and owner of Mac|Jesus, LLC, specializing in Mac and Windows integration and providing solutions to small- and medium-size businesses. He brings 19 years of experience and multiple certifications from seve...

Editor's Picks

Free Newsletters, In your Inbox