ANAVEM
Languagefr
How to Fix Microsoft Intune Device Internal Service Error Code 0x80180006

How to Fix Microsoft Intune Device Internal Service Error Code 0x80180006

Resolve the 0x80180006 error during Microsoft Intune device enrollment by troubleshooting MDM server exceptions, cleaning enrollment artifacts, and fixing configuration issues.

March 31, 2026 18 min
hardintune 8 steps 18 min

What Causes Microsoft Intune Error Code 0x80180006?

Error code 0x80180006 represents an unhandled exception on the Microsoft Intune MDM server during device enrollment. This error typically manifests when Windows devices attempt to register with Intune but encounter server-side processing failures due to configuration mismatches, corrupted enrollment artifacts, or connectivity issues.

Why Does This Error Occur During Device Enrollment?

The 0x80180006 error stems from several root causes. Network connectivity problems, particularly on corporate WiFi networks that don't whitelist Intune endpoints, frequently trigger this exception. Expired or corrupted enrollment certificates from previous failed attempts create conflicts during the enrollment handshake. Incorrect Entra ID (Azure AD) MDM scope configurations, where the MDM user scope isn't set to "All" or WIP scope isn't set to "None," prevent proper enrollment authorization.

How Does This Error Impact Enterprise Device Management?

When devices can't enroll in Intune due to 0x80180006 errors, organizations lose critical management capabilities. Affected devices can't receive security policies, compliance settings, or application deployments. This creates security gaps and prevents IT administrators from maintaining consistent device configurations across their fleet. The error particularly impacts hybrid work environments where remote devices need Intune management for secure access to corporate resources.

This comprehensive troubleshooting guide walks you through systematic resolution steps, from basic connectivity verification to advanced registry cleanup and alternative enrollment methods. Each step includes verification commands to confirm successful remediation before proceeding to the next phase.

Implementation Guide

Full Procedure

01

Verify Intune Service Health and Basic Prerequisites

Start by confirming that Microsoft Intune services are operational and your environment meets basic requirements. This error often stems from service disruptions or environmental issues.

Navigate to the Microsoft 365 admin center at admin.microsoft.com and check service health:

# Open admin center in browser
Start-Process "https://admin.microsoft.com"
# Navigate to Health > Service health > Microsoft Intune

Verify these basic requirements on the affected device:

# Check Windows version (must be Pro or higher)
Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion

# Verify system time is correct
Get-Date
w32tm /query /status

# Test internet connectivity to Intune endpoints
Test-NetConnection -ComputerName "enrollment.manage.microsoft.com" -Port 443
Test-NetConnection -ComputerName "portal.manage.microsoft.com" -Port 443
Pro tip: Corporate WiFi often blocks Intune endpoints. Test enrollment on a mobile hotspot first to isolate network issues.

Verification: Confirm all connectivity tests return TcpTestSucceeded: True and service health shows no active incidents.

02

Update Company Portal App and Clear Cache

An outdated or corrupted Company Portal app frequently causes enrollment exceptions. Update to the latest version and clear any cached data.

Update Company Portal through Microsoft Store:

# Open Microsoft Store and update Company Portal
Start-Process "ms-windows-store://pdp/?productid=9WZDNCRFJ3PZ"

# Alternative: Use winget to update
winget upgrade "Microsoft Corporation.CompanyPortal"

If the app continues causing issues, perform a complete reinstall:

# Uninstall Company Portal (run as admin)
Get-AppxPackage -Name "Microsoft.CompanyPortal" | Remove-AppxPackage

# Clear app data folders
Remove-Item -Path "$env:LOCALAPPDATA\Packages\Microsoft.CompanyPortal_*" -Recurse -Force -ErrorAction SilentlyContinue

# Reinstall from Microsoft Store
Start-Process "ms-windows-store://pdp/?productid=9WZDNCRFJ3PZ"
Warning: Removing Company Portal will sign out the user from all work accounts. Document any saved credentials before proceeding.

Verification: Launch Company Portal and confirm it displays the latest interface without error messages. Check version in Settings > About.

03

Configure Entra ID MDM Enrollment Scopes

Incorrect MDM user scopes in Entra ID are a primary cause of 0x80180006 errors. The MDM scope must be set to "All" and WIP scope to "None" for proper enrollment.

Access Entra ID admin center and configure MDM settings:

# Open Entra ID admin center
Start-Process "https://entra.microsoft.com"
# Navigate to Mobility (MDM and WIP) > Microsoft Intune

Configure the following settings in the Entra ID portal:

  • MDM user scope: Set to "All"
  • MDM URLs: Use default values (auto-populated)
  • WIP user scope: Set to "None"
  • WIP URLs: Leave empty when WIP scope is None

You can also verify current settings using Microsoft Graph PowerShell:

# Install and connect to Microsoft Graph
Install-Module Microsoft.Graph -Force
Connect-MgGraph -Scopes "DeviceManagementConfiguration.Read.All"

# Check current MDM configuration
Get-MgDeviceManagementMobilityManagementPolicy | Format-List
Pro tip: Changes to MDM scopes can take up to 15 minutes to propagate. Wait before attempting re-enrollment.

Verification: Confirm MDM user scope shows "All" and WIP user scope shows "None" in the Entra ID portal. The configuration should display "Microsoft Intune" as the MDM application.

04

Clean Existing Enrollment Certificates and Registry Entries

Corrupted enrollment certificates and registry entries from previous failed attempts must be removed before re-enrollment. This step requires administrative privileges.

Remove enrollment certificates using MMC:

# Open Certificate Manager
mmc.exe
# Add Certificates snap-in > Computer account > Local Computer
# Navigate to Personal > Certificates
# Delete any certificates issued by "Sc_Online_Issuing"

Clean enrollment-related registry entries:

# Run PowerShell as Administrator
# Remove enrollment registry keys
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Enrollments" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\OnlineManagement" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "HKCR:\Installer\Products\6985F0077D3EEB44AB6849B5D7913E95" -Recurse -Force -ErrorAction SilentlyContinue

# Clear additional enrollment artifacts
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\MDM" -Recurse -Force -ErrorAction SilentlyContinue

Remove any existing work or school accounts:

# List current work accounts
dsregcmd /status

# If domain joined, unjoin (requires restart)
# Remove-Computer -UnjoinDomainCredential (Get-Credential) -Restart

# Remove Azure AD registration if present
dsregcmd /leave
Warning: Registry modifications can cause system instability. Create a system restore point before proceeding: Checkpoint-Computer -Description "Before Intune cleanup"

Verification: Run dsregcmd /status to confirm no existing enrollments. Check certificate store shows no Intune-related certificates.

05

Temporarily Disable Windows Firewall for Testing

Windows Firewall can block MDM communication, causing enrollment exceptions. Temporarily disable it to test if firewall rules are the root cause.

Disable Windows Firewall on all profiles:

# Run as Administrator
# Disable Windows Firewall for all profiles
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

# Verify firewall status
Get-NetFirewallProfile | Select-Object Name, Enabled

Alternative method using netsh:

# Disable firewall using netsh (run as admin)
netsh advfirewall set allprofiles state off

# Check status
netsh advfirewall show allprofiles

If disabling firewall resolves the issue, create specific rules instead of leaving it disabled:

# Create Intune firewall rules (after testing)
New-NetFirewallRule -DisplayName "Intune Enrollment" -Direction Outbound -Protocol TCP -RemotePort 443 -RemoteAddress "enrollment.manage.microsoft.com" -Action Allow
New-NetFirewallRule -DisplayName "Intune Portal" -Direction Outbound -Protocol TCP -RemotePort 443 -RemoteAddress "portal.manage.microsoft.com" -Action Allow
Pro tip: Document your original firewall state before disabling: Get-NetFirewallProfile | Export-Clixml -Path "C:\temp\firewall-backup.xml"

Verification: Confirm all firewall profiles show Enabled: False. After testing, re-enable firewall: Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True

06

Attempt Alternative Enrollment Method

If standard Company Portal enrollment fails, use the alternative "Enroll only in device management" method through Windows Settings. This bypasses some Company Portal dependencies.

Access Windows Settings enrollment:

# Open Settings directly to Work or School accounts
Start-Process "ms-settings:workplace"

# Alternative: Use URI to open specific page
Start-Process "ms-settings:workplace"

Follow this specific enrollment sequence:

  1. Click "Connect" or "Add work or school account"
  2. Select "Enroll only in device management"
  3. Enter your work email address
  4. Complete authentication
  5. Restart the device when prompted

After restart, register in Company Portal without full management:

# Launch Company Portal after restart
Start-Process "ms-windows-store://pdp/?productid=9WZDNCRFJ3PZ"

# In Company Portal: Sign in but do NOT check
# "Allow my organization to manage this device"
Warning: "Enroll only in device management" provides limited MDM functionality. Full enrollment may still be required for complete policy application.

Verification: Check enrollment status with dsregcmd /status. Look for "AzureAdJoined: YES" and "DomainJoined: NO" indicating successful Azure AD registration.

07

Perform Full Re-enrollment and Verify Success

With cleanup complete and configurations corrected, attempt full enrollment through Company Portal. Monitor the process for any remaining errors.

Launch Company Portal and begin enrollment:

# Clear any cached credentials
cmdkey /list | findstr "MicrosoftAccount" | ForEach-Object { cmdkey /delete:($_ -split " ")[1] }

# Launch Company Portal
Start-Process "companyportal:"

# Alternative launch method
Start-Process "ms-windows-store://pdp/?productid=9WZDNCRFJ3PZ"

Monitor enrollment progress and capture detailed logs:

# Enable MDM diagnostic logging
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\MDM\Diagnostics" /v MdmLogLevel /t REG_DWORD /d 4 /f

# Start enrollment monitoring
Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" -MaxEvents 50 | Format-Table TimeCreated, LevelDisplayName, Message -Wrap

Check enrollment status during and after the process:

# Monitor enrollment status
dsregcmd /status

# Check MDM enrollment specifically
Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Enrollments" -ErrorAction SilentlyContinue

# Verify Intune management
Get-ScheduledTask | Where-Object {$_.TaskName -like "*Intune*" -or $_.TaskName -like "*MDM*"}
Pro tip: If enrollment stalls at a specific percentage, wait 10-15 minutes before canceling. Initial policy sync can take time on slower connections.

Verification: Successful enrollment shows "MDMEnrolled: YES" in dsregcmd output, Intune scheduled tasks are present, and Company Portal displays device compliance status without errors.

08

Analyze Event Logs and Implement Final Troubleshooting

If enrollment still fails, analyze Windows Event Logs for specific error details and implement advanced troubleshooting techniques.

Examine MDM-related event logs:

# Check Device Management logs
Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" | Where-Object {$_.Id -eq 1006 -or $_.Id -eq 1007} | Format-List TimeCreated, Id, LevelDisplayName, Message

# Check Enrollment logs
Get-WinEvent -LogName "Microsoft-Windows-AAD/Operational" | Where-Object {$_.Message -like "*enrollment*"} | Select-Object TimeCreated, Id, Message

# Check for certificate errors
Get-WinEvent -LogName "Application" | Where-Object {$_.Source -eq "Microsoft-Windows-CertificateServicesClient-Lifecycle-System" -and $_.LevelDisplayName -eq "Error"}

Generate comprehensive diagnostic report:

# Create MDM diagnostic report
$OutputPath = "C:\temp\MDM-Diagnostics-$(Get-Date -Format 'yyyyMMdd-HHmmss').txt"
New-Item -Path "C:\temp" -ItemType Directory -Force

# Gather system information
@"
MDM Diagnostic Report - $(Get-Date)
=====================================

System Information:
$(Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, TotalPhysicalMemory | Out-String)

DSRegCmd Status:
$(dsregcmd /status)

Network Connectivity:
$(Test-NetConnection -ComputerName "enrollment.manage.microsoft.com" -Port 443 | Out-String)
$(Test-NetConnection -ComputerName "portal.manage.microsoft.com" -Port 443 | Out-String)

Enrollment Registry Keys:
$(Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Enrollments" -Recurse -ErrorAction SilentlyContinue | Out-String)

Recent MDM Events:
$(Get-WinEvent -LogName "Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin" -MaxEvents 20 -ErrorAction SilentlyContinue | Format-Table TimeCreated, Id, LevelDisplayName, Message -Wrap | Out-String)
"@ | Out-File -FilePath $OutputPath -Encoding UTF8

Write-Host "Diagnostic report saved to: $OutputPath"

Implement final troubleshooting steps:

# Reset Windows Update components (can affect enrollment)
Stop-Service wuauserv, cryptSvc, bits, msiserver -Force
Rename-Item "$env:SystemRoot\SoftwareDistribution" "SoftwareDistribution.old" -Force
Rename-Item "$env:SystemRoot\System32\catroot2" "catroot2.old" -Force
Start-Service wuauserv, cryptSvc, bits, msiserver

# Clear DNS cache
Clear-DnsClientCache

# Reset network stack
netsh winsock reset
netsh int ip reset
Warning: If all troubleshooting steps fail, the issue may require Microsoft Support intervention. Prepare the diagnostic report and error screenshots for support ticket submission.

Verification: Review the diagnostic report for patterns. Successful resolution shows clean event logs, proper registry entries, and successful test connections to Intune endpoints.

Frequently Asked Questions

What does Microsoft Intune error code 0x80180006 mean exactly?+
Error code 0x80180006 indicates an unhandled exception occurred on the Microsoft Intune MDM server during device enrollment. This server-side error typically results from configuration mismatches, network connectivity issues, corrupted enrollment certificates, or incorrect Entra ID MDM scope settings. The error prevents Windows devices from successfully registering with Intune for mobile device management.
Why does 0x80180006 error occur on corporate WiFi networks?+
Corporate WiFi networks often block or restrict access to Microsoft Intune endpoints required for device enrollment. Firewalls, proxy servers, and content filtering systems may prevent communication with domains like enrollment.manage.microsoft.com and portal.manage.microsoft.com. This network blocking triggers the 0x80180006 exception when the enrollment process cannot complete the server handshake. Testing enrollment on a mobile hotspot often resolves this issue temporarily.
How do I clean corrupted Intune enrollment certificates causing 0x80180006?+
Open Certificate Manager (mmc.exe), add the Certificates snap-in for Computer account, and navigate to Personal > Certificates. Delete any certificates issued by 'Sc_Online_Issuing' which are remnants from failed Intune enrollments. Additionally, clean registry entries at HKLM\SOFTWARE\Microsoft\Enrollments and HKLM\SOFTWARE\Microsoft\OnlineManagement using PowerShell Remove-Item commands. This removes corrupted enrollment artifacts that cause server exceptions.
What Entra ID MDM scope settings prevent 0x80180006 errors?+
In the Entra ID admin center, navigate to Mobility (MDM and WIP) > Microsoft Intune and configure MDM user scope to 'All' and WIP user scope to 'None'. Incorrect scope settings where MDM is limited to specific groups or WIP is enabled can cause enrollment authorization failures resulting in 0x80180006 errors. These configuration changes can take up to 15 minutes to propagate across Microsoft's infrastructure.
When should I contact Microsoft Support for 0x80180006 errors?+
Contact Microsoft Support when systematic troubleshooting including network testing, certificate cleanup, registry cleaning, MDM scope configuration, and alternative enrollment methods all fail to resolve the error. Prepare a comprehensive diagnostic report including dsregcmd output, Event Viewer logs from DeviceManagement-Enterprise-Diagnostics-Provider, network connectivity test results, and screenshots of the error. Persistent 0x80180006 errors after following all troubleshooting steps may indicate backend service issues requiring Microsoft intervention.

Discussion

Share your thoughts and insights

Sign in to join the discussion