How to get Microsoft Defender Health on Mac Fleet

by | Nov 1, 2022

Managing Macs for multiple companies gives us the opportunity to work in various environment and detect issues where it occurs first & then implement a solution for all others at the same time.

Recently there was a requirement to find if there are MDD instances running on Macs that have issues. We found a couple of scripts that claimed to do the job but one or the other bit was missing in all of those. So, we had to resort to what Microsft suggests – use mdatp binary that comes with the MDD installer. >> mdatp health
healthy                                     : false
health_issues                               : ["full disk access has not been granted"]
licensed                                    : true
engine_version                              : "1.2.16600.3"
app_version                                 : "101.97.30"
org_id                                      : "bitsys-technologies-ab-sweden"
log_level                                   : "info"
machine_guid                                : "14771-popo-1432-iioo-100a200b300c"
release_ring                                : "Production"
product_expiration                          : Apr 25, 2025 at 00:00:01 AM
cloud_enabled                               : true
cloud_automatic_sample_submission_consent   : "safe"
cloud_diagnostic_enabled                    : true
passive_mode_enabled                        : true
real_time_protection_enabled                : true
real_time_protection_available              : true
real_time_protection_subsystem              : "endpoint_security_extension"
network_events_subsystem                    : "network_filter_extension"
device_control_enforcement_level            : "audit"
tamper_protection                           : "audit"
automatic_definition_update_enabled         : true
definitions_updated                         : Nov 24, 2022 at 09:37:56 PM
definitions_updated_minutes_ago             : 13
definitions_version                         : "1.379.884.0"
definitions_status                          : "up_to_date"
edr_early_preview_enabled                   : "enabled"
edr_device_tags                             : []
edr_group_ids                               : ""
edr_configuration_version                   : "20.199999.main.2022.11.17.07-3577429fa2e8bcc5249db25a9ea07439a10387f2"
edr_machine_id                              : "9d9d93j38djddi97eeba16299ce7665d822d52348"
conflicting_applications                    : []
network_protection_status                   : "stopped"
network_protection_enforcement_level        : "disabled"
data_loss_prevention_status                 : "disabled"
full_disk_access_enabled                    : false

When we run mdatp health, it shows all the components that make MDD healthy. So, instead of just finding one component that we believe is enough, we look at the aggregate i.e. ‘health’.

Wait, there is more!

So, now you know what to look for, there is more that can be done via script.

For e.g. >> mdatp health --field healthy

Grep the health status with the command listed above.

Or, you can also find out what exactly is causing the issue: >> mdatp health --field healthy && mdatp health --field health_issues
["full disk access has not been granted"]
MDD Commands on Mac

Now create a script with a couple of lines – test if MDD is running or not, if not, then exit the script, else find the health status with the command listed above.

When it comes to scripting, I am sure you can have a smarter approach, but for beginners, I’d suggest doing it in 3 steps:

If binary exists > then check mdatp health –field healthy > if it’s NOT healthy then mdatp health –field health_issues. For all 3 steps, if the other condition matches, then exit the script with some logs.

Visit this MS KB for more information on Troubleshooting Defender on macOS.

Tweet us @BitSysTech if you have questions. We’d love to discuss this.

Implementing Machine Learning in IT Support Setup

Machine learning has the potential to revolutionize the way IT support businesses operate. This cutting-edge technology can be applied in a number of ways to improve the efficiency, accuracy, and speed of IT support services. Here are some ways that machine learning...

Benefits of Apple Business Managers

Apple Business Manager is a web-based platform designed to streamline the process of purchasing, deploying, and managing Apple devices within a business organization. It allows IT administrators to manage and distribute Apple devices and apps to their employees,...

Adoption of Macs in Enterprise: A Growing Trend

This image belongs to In recent years, there has been a growing trend of enterprises adopting Macs as their primary desktop and laptop computers. This shift in technology can be attributed to several factors, including...

ESG as future of IT

ESG, or environmental, social, and governance, is becoming increasingly important in the field of IT. As technology continues to advance and play a larger role in our daily lives, companies are being held to higher standards in terms of their impact on the environment...

Secure Your Mac with FileVault

FileVault is a built-in encryption tool for Macs that helps protect your data from unauthorized access by encrypting your hard drive. Enabling FileVault is a simple process that only takes a few minutes, and it can give you peace of mind knowing that your data is safe...

Is outsourcing IT to India is better or keeping it inhouse?

There are pros and cons to both outsourcing IT services to India and keeping IT within the company. Ultimately, the decision to outsource or keep IT in-house will depend on the specific needs and goals of the company, as well as the resources and capabilities...

How to be a good SCRUM Master

In an Agile development team, the Scrum Master is a crucial role that helps the team to work effectively and efficiently. A Scrum Master is responsible for facilitating the team's use of the Scrum framework and ensuring that the team is able to deliver high-quality...

Basics of Enterprise Patch Management

Enterprise patch management is the process of ensuring that all the software and applications within an organization are kept up-to-date with the latest patches and updates. This is important because software and applications are constantly being improved and updated...

Cost saving for enterprises by choosing M1 Macs

The M1 Mac has had a significant impact on the enterprise market since its release. As a highly-efficient and powerful machine, the M1 Mac has proven to be a valuable asset to businesses in a variety of industries. One of the key benefits of the M1 Mac is its improved...

CRM Is A Process, Not A Product! How Can We Make CRM A Successful Tool?

CRM (Customer Relationship Management) is software that allows businesses to manage business relationships and information associated with them. It provides a platform that manages interactions with customers, stores information about them, and automates processes...


Digital Workplace Services

Automated Tasks

 Office IT Support

Intune for Win & Mac

Citrix Virtual Apps

Mac Win iOS Android

Mac & Win Trained