Skip to content

IntuneDeviceConfigurationCustomPolicyMacOS

Parameters

Parameter Attribute DataType Description Allowed Values
Assignments Write MSFT_DeviceManagementConfigurationPolicyAssignments[] Represents the assignment to the Intune policy.
DeploymentChannel Write String Indicates the channel used to deploy the configuration profile. Available choices are DeviceChannel, UserChannel. Possible values are: deviceChannel, userChannel, unknownFutureValue. deviceChannel, userChannel, unknownFutureValue
Description Write String Admin provided description of the Device Configuration.
DisplayName Key String Admin provided name of the device configuration.
Id Write String The unique identifier for an entity. Read-only.
Payload Write String Payload. (UTF8 encoded byte array)
PayloadFileName Write String Payload file name (.mobileconfig
PayloadName Write String Name that is displayed to the user.
RoleScopeTagIds Write String[] List of Scope Tags for this Entity instance.
Ensure Write String Specify if the policy should exist. Present, Absent
Credential Write PSCredential Credentials of the Intune Admin
ApplicationId Write String Id of the Entra ID application to authenticate with.
TenantId Write String Id of the Entra ID tenant used for authentication.
ApplicationSecret Write PSCredential Secret of the Entra ID application to authenticate with.
CertificateThumbprint Write String Thumbprint of the Entra ID 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 String[] Access token used for authentication.

Embedded Instances

MSFT_DeviceManagementConfigurationPolicyAssignments

Parameters

Parameter Attribute DataType Description Allowed Values
dataType Required String The type of the target assignment. #microsoft.graph.cloudPcManagementGroupAssignmentTarget, #microsoft.graph.groupAssignmentTarget, #microsoft.graph.allLicensedUsersAssignmentTarget, #microsoft.graph.allDevicesAssignmentTarget, #microsoft.graph.exclusionGroupAssignmentTarget, #microsoft.graph.configurationManagerCollectionAssignmentTarget
deviceAndAppManagementAssignmentFilterType Write String The type of filter of the target assignment i.e. Exclude or Include. Possible values are:none, include, exclude. none, include, exclude
deviceAndAppManagementAssignmentFilterId Write String The Id of the filter for the target assignment.
deviceAndAppManagementAssignmentFilterDisplayName Write String The display name of the filter for the target assignment.
groupId Write String The group Id that is the target of the assignment.
groupDisplayName Write String The group Display Name that is the target of the assignment.
collectionId Write String The collection Id that is the target of the assignment.(ConfigMgr)

Description

This resource configures a Intune Device Configuration Custom Policy for macOS.

Permissions

Graph

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

Delegated permissions

  • Read
  • GroupMember.Read.All, DeviceManagementConfiguration.Read.All, DeviceManagementRBAC.Read.All

  • Update

  • GroupMember.Read.All, DeviceManagementConfiguration.ReadWrite.All, DeviceManagementRBAC.Read.All

Application permissions

  • Read
  • GroupMember.Read.All, DeviceManagementConfiguration.Read.All, DeviceManagementRBAC.Read.All

  • Update

  • GroupMember.Read.All, DeviceManagementConfiguration.ReadWrite.All, DeviceManagementRBAC.Read.All

Examples

Example 1

This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.

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

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

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        IntuneDeviceConfigurationCustomPolicyMacOS 'IntuneDeviceConfigurationCustomPolicyMacOS-Example'
        {
            Assignments           = @(
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    dataType                                   = "#microsoft.graph.allDevicesAssignmentTarget"
                    deviceAndAppManagementAssignmentFilterType = "none"
                }
            );
            DeploymentChannel     = "deviceChannel";
            Description           = "Pins the Safari homepage on managed Macs";
            DisplayName           = "macOS Safari Homepage";
            Payload               = @'
<?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>PayloadContent</key>
    <array>
        <dict>
            <key>PayloadDisplayName</key>
            <string>Safari Homepage</string>
            <key>PayloadIdentifier</key>
            <string>com.contoso.safari.homepage</string>
            <key>PayloadType</key>
            <string>com.apple.Safari</string>
            <key>PayloadUUID</key>
            <string>2c9e2f0b-2b3a-4e45-9e6d-4f0f5f2d9a11</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <key>HomePage</key>
            <string>https://intranet.contoso.com</string>
        </dict>
    </array>
    <key>PayloadDisplayName</key>
    <string>Contoso Safari Homepage</string>
    <key>PayloadIdentifier</key>
    <string>com.contoso.safari</string>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>8f4c1b6d-7b1e-4e7f-9c23-1d2b3a4c5d6e</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
</dict>
</plist>
'@;
            PayloadFileName       = "contoso-safari-homepage.mobileconfig";
            PayloadName           = "Contoso Safari Homepage";
            RoleScopeTagIds       = @("0");
            Ensure                = "Present";
            ApplicationId         = $ApplicationId;
            TenantId              = $TenantId;
            CertificateThumbprint = $CertificateThumbprint;
        }
    }
}

Example 2

This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.

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

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

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        IntuneDeviceConfigurationCustomPolicyMacOS 'IntuneDeviceConfigurationCustomPolicyMacOS-Example'
        {
            Assignments           = @(
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    dataType                                   = "#microsoft.graph.allDevicesAssignmentTarget"
                    deviceAndAppManagementAssignmentFilterType = "none"
                }
            );
            DeploymentChannel     = "deviceChannel";
            Description           = "Pins the Safari homepage on managed Macs in the Zurich office"; # Updated Property
            DisplayName           = "macOS Safari Homepage";
            Payload               = @'
<?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>PayloadContent</key>
    <array>
        <dict>
            <key>PayloadDisplayName</key>
            <string>Safari Homepage</string>
            <key>PayloadIdentifier</key>
            <string>com.contoso.safari.homepage</string>
            <key>PayloadType</key>
            <string>com.apple.Safari</string>
            <key>PayloadUUID</key>
            <string>2c9e2f0b-2b3a-4e45-9e6d-4f0f5f2d9a11</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <key>HomePage</key>
            <string>https://intranet.contoso.com</string>
        </dict>
    </array>
    <key>PayloadDisplayName</key>
    <string>Contoso Safari Homepage</string>
    <key>PayloadIdentifier</key>
    <string>com.contoso.safari</string>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>8f4c1b6d-7b1e-4e7f-9c23-1d2b3a4c5d6e</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
</dict>
</plist>
'@;
            PayloadFileName       = "contoso-safari-homepage.mobileconfig";
            PayloadName           = "Contoso Safari Homepage";
            RoleScopeTagIds       = @("0");
            Ensure                = "Present";
            ApplicationId         = $ApplicationId;
            TenantId              = $TenantId;
            CertificateThumbprint = $CertificateThumbprint;
        }
    }
}

Example 3

This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.

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

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

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )

    Import-DscResource -ModuleName Microsoft365DSC

    Node localhost
    {
        IntuneDeviceConfigurationCustomPolicyMacOS 'IntuneDeviceConfigurationCustomPolicyMacOS-Example'
        {
            DisplayName           = "macOS Safari Homepage";
            Ensure                = "Absent";
            ApplicationId         = $ApplicationId;
            TenantId              = $TenantId;
            CertificateThumbprint = $CertificateThumbprint;
        }
    }
}