> ## Documentation Index
> Fetch the complete documentation index at: https://ps365.clidsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set-IntuneAutoMDMEnrollmentPolicy

## SYNOPSIS

Configures the MDM enrollment policy for Microsoft Entra ID.

## SYNTAX

```powershell theme={null}
Set-IntuneAutoMDMEnrollmentPolicy [-State] <String> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
 [<CommonParameters>]
```

## DESCRIPTION

This function enables or disables automatic MDM enrollment during device
registration in Microsoft Entra ID.

## EXAMPLES

### EXAMPLE 1

```powershell theme={null}
Set-IntuneAutoMDMEnrollmentPolicy -State 'Disabled'
```

Disables automatic MDM enrollment during device registration.

### EXAMPLE 2

```powershell theme={null}
Set-IntuneAutoMDMEnrollmentPolicy -State 'Enabled'
```

Enables automatic MDM enrollment during device registration.

## PARAMETERS

### -State

Specifies whether MDM enrollment should be enabled or disabled during registration.

* 'Enabled'  : Enables automatic MDM enrollment (sets isMdmEnrollmentDuringRegistrationDisabled to false)
* 'Disabled' : Disables automatic MDM enrollment (sets isMdmEnrollmentDuringRegistrationDisabled to true)

```yaml theme={null}
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf

Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml theme={null}
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm

Prompts you for confirmation before running the cmdlet.

```yaml theme={null}
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

## NOTES

Requires the following Microsoft Graph permissions:

* Policy.ReadWrite.MobilityManagement

Connect-MgGraph -Scopes 'Policy.ReadWrite.MobilityManagement'

## RELATED LINKS

[https://ps365.clidsys.com/docs/commands/Set-IntuneAutoMDMEnrollmentPolicy](https://ps365.clidsys.com/docs/commands/Set-IntuneAutoMDMEnrollmentPolicy)
