Easy way to analyse MDM Diagnostic data on the client

In this blog I would like to give you a helpful tool how you can analyze the MDM diagnostic log directly on the client with the help of PowerShell and how you can process the content in a simple way to implement remediations or to build a monitoring. In the following sections I will explain step by step how you can use this script.

Where can you find the script?

you can find the script in my GitHub Repository.

https://github.com/JayRHa/Intune-Scripts/tree/main/Get-MdmDiagnostigLogs

How does the script works?

How can I call the script?

The script has three different parameter:

ParameterDescription
collectNew(Switch) Create a new mdm log or use the existing one (If not exist a new one will be created)
returnonly(Switch) Returns an object of not set the object will printed out in the console
output(List) Define the output information you want to have. If you want all you can specify ‘All’
Supported values:
‘All’,’ActiveSync’,’DeviceManageabilityProviderInfo’,’DeviceManagementAccount’,’Diagnostics’,’EAS’,’Enrollments’,’EnterpriseDesktopAppManagementinfo’,’FirstSyncData’,’MdmWinsOverGp’,’PolicyManager’,’PolicyManagerMeta’,’ProvisioningResults’,’Resources’,’SCEP’,’SystemInformation’,’Version’,’WAP’

Here some examples how you can call the script:

Get ‘FirstSyncData’, ‘SystemInformation’ as output in the the terminal

Get-MdmDiagnosticLogObject -output @('FirstSyncData', 'SystemInformation')

Get ‘FirstSyncData’, ‘SystemInformation’ as return value into an variable

$mdmDiagnostic = Get-MdmDiagnosticLogObject -returnonly -output @('FirstSyncData', 'SystemInformation')

Generate a new logfile and get ‘FirstSyncData’, ‘SystemInformation’ as return value into an variable

$mdmDiagnostic = Get-MdmDiagnosticLogObject -returnonly -collectNew -output @('FirstSyncData', 'SystemInformation')

Get all device configuration object meta data

$mdmLogInfo = Get-MdmDiagnosticLogObject -output @('PolicyManagerMeta') -returnonly
Write-Output $mdmLogInfo.PolicyManagerMeta.AreaMetadata

One thought on “Easy way to analyse MDM Diagnostic data on the client

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s