mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 16:39:01 +00:00
MDM docs: Instructions for viewing recent MDM commands (#12006)
- Add section for viewing recent MDM commands using fleetctl get mdm-commands - Add example output for fleetctl get mdm-commands and fleetctl get mdm-command-results
This commit is contained in:
parent
695fa7d1b0
commit
2f59a8cde1
2 changed files with 46 additions and 1 deletions
1
changes/issue-11008-document-get-mdm-commands
Normal file
1
changes/issue-11008-document-get-mdm-commands
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Added documentation in the guide for `fleetctl get mdm-commands`.
|
||||
|
|
@ -51,7 +51,7 @@ Fleet UI:
|
|||
1. Head to the **Hosts** page in Fleet and find your target host.
|
||||
2. Make sure the **Hostname** column is visible (select **Edit columns** if not) and find your host's hostname. You'll need this hostname to run the command.
|
||||
|
||||
> A host must be enrolled to Fleet and have MDM turned on to run an command against it.
|
||||
> A host must be enrolled to Fleet and have MDM turned on to run a command against it.
|
||||
|
||||
`fleetctl` CLI:
|
||||
|
||||
|
|
@ -65,11 +65,55 @@ Fleet UI:
|
|||
|
||||
2. Look at the on-screen information. In the output you'll see the command required to see results. Be sure to copy this command. If you don't, it will be difficult to view command results later.
|
||||
|
||||
Example output:
|
||||
|
||||
```
|
||||
+--------------------------------------+----------------------+----------------+--------------+---------------------+-------------------------------------------------------+
|
||||
| ID | TIME | TYPE | STATUS | HOSTNAME | RESULTS |
|
||||
+--------------------------------------+----------------------+----------------+--------------+---------------------+-------------------------------------------------------+
|
||||
| 333af7f8-b9a4-4f62-bfb2-f7488fbade21 | 2023-04-04T21:29:29Z | RestartDevice | Acknowledged | mos-macbook-air.lan | <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE |
|
||||
| | | | | | plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" |
|
||||
| | | | | | "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
|
||||
| | | | | | <plist version="1.0"> <dict> <key>CommandUUID</key> |
|
||||
| | | | | | <string>333af7f8-b9a4-4f62-bfb2-f7488fbade21</string> |
|
||||
| | | | | | <key>Status</key> |
|
||||
| | | | | | <string>Acknowledged</string> <key>UDID</key> |
|
||||
| | | | | | <string>3A529CD6-2154-55EA-9AB7-EB13A43D9F5E</string> |
|
||||
| | | | | | </dict> </plist> |
|
||||
+--------------------------------------+----------------------+----------------+--------------+---------------------+-------------------------------------------------------+
|
||||
```
|
||||
|
||||
### Step 4: View the command's results
|
||||
|
||||
1. Run the `fleetctl get mdm-command-results --id=<insert-command-id>`
|
||||
|
||||
2. Look at the on-screen information.
|
||||
|
||||
## List recent commands
|
||||
|
||||
You can view the list of the 1,000 latest commands using "fleetctl":
|
||||
|
||||
1. Run `fleetctl get mdm-commands`
|
||||
2. View the list of latest commands, most recent first, along with the timestamp, targeted hostname, command type, execution status and command ID.
|
||||
|
||||
Example output:
|
||||
|
||||
```
|
||||
$ fleetctl get mdm-commands
|
||||
+--------------------------------------+----------------------+--------------------------+--------------+------------------------+
|
||||
| ID | TIME | TYPE | STATUS | HOSTNAME |
|
||||
+--------------------------------------+----------------------+--------------------------+--------------+------------------------+
|
||||
| 024fb3b9-cd8a-40a6-8dd7-6c155f488fd1 | 2023-04-12T18:19:10Z | RestartDevice | Acknowledged | iMac-Pro.local |
|
||||
+--------------------------------------+----------------------+--------------------------+--------------+------------------------+
|
||||
| 87dc6325-8bc0-4fc8-9a2f-3901c535456e | 2023-04-12T18:15:01Z | DeviceLock | Acknowledged | iMac-Pro.local |
|
||||
+--------------------------------------+----------------------+--------------------------+--------------+------------------------+
|
||||
```
|
||||
|
||||
The command ID can be used to view command results as documented in [step 4 of the previous section](#step-4-view-the-commands-results). The possible status values are:
|
||||
* Pending: the command has yet to run on the host. The host will run the command the next time it comes online.
|
||||
* Acknowledged: the host responded with "Acknowledged" status via the MDM protocol: the host processed the command successfully.
|
||||
* Error: the host responded with "Error" status via the MDM protocol: an error occurred. Run the `fleetctl get mdm-command-results --id=<insert-command-id` to view the error.
|
||||
* CommandFormatError: the host responded with "CommandFormatError" status via the MDM protocol: a protocol error occurred, which can result from a malformed command. Run the `fleetctl get mdm-command-results --id=<insert-command-id` to view the error.
|
||||
|
||||
<meta name="pageOrderInSection" value="1506">
|
||||
<meta name="title" value="MDM commands">
|
||||
|
|
|
|||
Loading…
Reference in a new issue