Skip to content

IntuneDeviceManagementDeviceDiagnosticSettings

Parameters

Parameter Attribute DataType Description Allowed Values
IsSingleInstance Key String Only valid value is 'Yes'. Yes
EnableLogCollection Write Boolean Determines whether the log collection feature should be available for use.
EnableAutopilotDiagnostics Write Boolean Determines whether the autopilot diagnostic feature is enabled or not.
M365AppDiagnosticsEnabled Write Boolean The property to determine if M365 App log collection is enabled for account. When TRUE it indicates that M365 app log collection is enabled for account. When FALSE it indicates that M365 app log collection is disabled for account. Default value is FALSE
Credential Write PSCredential Credentials of the Intune Admin
ApplicationId Write String Id of the Azure Active Directory application to authenticate with.
TenantId Write String Id of the Azure Active Directory tenant used for authentication.
ApplicationSecret Write PSCredential Secret of the Azure Active Directory tenant used for authentication.
CertificateThumbprint Write String Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.
CertificatePassword Write PSCredential Username can be made up to anything but password will be used for CertificatePassword
CertificatePath Write String Path to certificate used in service principal usually a PFX file.
ManagedIdentity Write Boolean Managed ID being used for authentication.
AccessTokens Write StringArray[] Access token used for authentication.

Description

This resource configures the device diagnostic settings at the tenant level.

Permissions

Graph

To authenticate with the Graph API, this resource requires the following permissions:

Delegated permissions

  • Read
  • DeviceManagementConfiguration.Read.All

  • Update

  • DeviceManagementConfiguration.ReadWrite.All

Application permissions

  • Read
  • DeviceManagementConfiguration.Read.All

  • Update

  • DeviceManagementConfiguration.ReadWrite.All

Examples

Example 1

This example updates the Device Management Compliance Settings

Configuration Example
{
    param(
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )
    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        IntuneDeviceManagementDeviceDiagnosticSettings 'DeviceManagementDeviceDiagnosticSettings'
        {
            IsSingleInstance           = "Yes";
            EnableLogCollection        = $true;
            EnableAutopilotDiagnostics = $true;
            M365AppDiagnosticsEnabled  = $true;
            ApplicationId              = $ApplicationId;
            TenantId                   = $TenantId;
            CertificateThumbprint      = $CertificateThumbprint;
        }
    }
}