{"id":9636,"date":"2026-05-11T10:39:28","date_gmt":"2026-05-11T10:39:28","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=9636"},"modified":"2026-05-11T10:39:29","modified_gmt":"2026-05-11T10:39:29","slug":"script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender","title":{"rendered":"Script to get list of Machines not enrolled into Intune but enrolled into Defender"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code class=\"\">&lt;#\n.SYNOPSIS\n    Gets all Defender onboarded devices NOT enrolled in Intune.\n    Filter by platform: \"Windows11\", \"iOS\", \"Android\", \"macOS\", \"\" (blank = all)\n\n.REQUIREMENTS\n    Install-Module Microsoft.Graph -Scope CurrentUser\n#>\n\n# ?? Configuration\n$ExportCSV      = $true\n$FilterPlatform = \"Windows11\"  # Change to \"iOS\", \"Android\", \"macOS\" or \"\" for all\n$ExportPath     = \".\\DefenderNotInIntune_${FilterPlatform}_$(Get-Date -Format 'yyyyMMdd_HHmmss').csv\"\n\n# ?? Login\nWrite-Host \"Opening browser for login...\" -ForegroundColor Cyan\n\nConnect-MgGraph -Scopes @(\n    \"DeviceManagementManagedDevices.Read.All\",\n    \"SecurityEvents.Read.All\",\n    \"ThreatHunting.Read.All\"\n) -NoWelcome\n\nWrite-Host \"  Logged in as : $((Get-MgContext).Account)\" -ForegroundColor Green\nWrite-Host \"  Tenant       : $((Get-MgContext).TenantId)\" -ForegroundColor Green\n\n# ?? Step 1: Get all Defender machines via Advanced Hunting\nWrite-Host \"`nFetching Defender onboarded devices via Advanced Hunting...\" -ForegroundColor Cyan\n\n$mdeLookup = @{}\n\n$huntingBody = @{\n    Query = @\"\nDeviceInfo\n| where isnotempty(AadDeviceId)\n| summarize arg_max(Timestamp, *) by AadDeviceId\n| project AadDeviceId, DeviceName, OSPlatform, OSVersion, OnboardingStatus, LoggedOnUsers\n\"@\n} | ConvertTo-Json\n\ntry {\n    $huntingResponse = Invoke-MgGraphRequest `\n        -Uri \"https:\/\/graph.microsoft.com\/v1.0\/security\/runHuntingQuery\" `\n        -Method POST `\n        -Body $huntingBody `\n        -ContentType \"application\/json\" `\n        -ErrorAction Stop\n\n    foreach ($row in $huntingResponse.results) {\n        if ($row.AadDeviceId) {\n\n            # Extract last logged on user from LoggedOnUsers JSON array\n            $lastUser = $null\n            if ($row.LoggedOnUsers) {\n                try {\n                    $users = $row.LoggedOnUsers | ConvertFrom-Json -ErrorAction SilentlyContinue\n                    if ($users -and $users.Count -gt 0) {\n                        $lastUser = \"$($users[0].DomainName)\\$($users[0].UserName)\"\n                    }\n                } catch {\n                    $lastUser = $row.LoggedOnUsers\n                }\n            }\n\n            $mdeLookup[$row.AadDeviceId.ToLower()] = [PSCustomObject]@{\n                DeviceName       = $row.DeviceName\n                OSPlatform       = $row.OSPlatform\n                OSVersion        = $row.OSVersion\n                OnboardingStatus = $row.OnboardingStatus\n                LastLoggedOnUser = $lastUser\n            }\n        }\n    }\n    Write-Host \"  Found $($mdeLookup.Count) Defender onboarded devices\" -ForegroundColor Green\n}\ncatch {\n    Write-Error \"Advanced Hunting failed: $_\"\n    Disconnect-MgGraph\n    exit 1\n}\n\nif ($mdeLookup.Count -eq 0) {\n    Write-Error \"No Defender devices returned. Check ThreatHunting.Read.All is consented.\"\n    Disconnect-MgGraph\n    exit 1\n}\n\n# ?? Step 2: Get all Intune enrolled device AAD IDs\nWrite-Host \"Fetching Intune enrolled devices...\" -ForegroundColor Cyan\n\n$intuneAadIds = [System.Collections.Generic.HashSet[string]]::new()\n$uri = \"https:\/\/graph.microsoft.com\/v1.0\/deviceManagement\/managedDevices?\" +\n       \"`$select=azureADDeviceId&amp;`$top=999\"\n\ndo {\n    $response = Invoke-MgGraphRequest -Uri $uri -Method GET\n    foreach ($device in $response.value) {\n        if ($device.azureADDeviceId) {\n            $null = $intuneAadIds.Add($device.azureADDeviceId.ToLower())\n        }\n    }\n    $uri = $response.'@odata.nextLink'\n} while ($uri)\n\nWrite-Host \"  Found $($intuneAadIds.Count) Intune devices\" -ForegroundColor Green\n\n# ?? Step 3: Find Defender devices NOT in Intune\nWrite-Host \"`nComparing...\" -ForegroundColor Cyan\n\n$results = foreach ($aadId in $mdeLookup.Keys) {\n    if ($aadId -notin $intuneAadIds) {\n        $defender = $mdeLookup[$aadId]\n        [PSCustomObject]@{\n            DeviceName       = $defender.DeviceName\n            OSPlatform       = $defender.OSPlatform\n            OSVersion        = $defender.OSVersion\n            OnboardingStatus = $defender.OnboardingStatus\n            LastLoggedOnUser = if ($defender.OSPlatform -like \"Windows*\") { $defender.LastLoggedOnUser } else { \"N\/A\" }\n            AzureADDeviceId  = $aadId\n        }\n    }\n}\n\n# ?? Apply platform filter\nif ($FilterPlatform) {\n    $filtered = $results | Where-Object { $_.OSPlatform -eq $FilterPlatform }\n} else {\n    $filtered = $results\n}\n\n# ?? Output\nWrite-Host \"`n================================================\" -ForegroundColor Yellow\nWrite-Host \"  Defender onboarded devices : $($mdeLookup.Count)\"    -ForegroundColor White\nWrite-Host \"  Intune enrolled devices    : $($intuneAadIds.Count)\"  -ForegroundColor White\nWrite-Host \"  In Defender NOT in Intune  : $($results.Count)\"       -ForegroundColor Red\nif ($FilterPlatform) {\nWrite-Host \"  Filtered ($FilterPlatform)  : $($filtered.Count)\"     -ForegroundColor Yellow\n}\nWrite-Host \"================================================\" -ForegroundColor Yellow\n\n$filtered | Format-Table DeviceName, OSPlatform, OSVersion, LastLoggedOnUser, AzureADDeviceId -AutoSize\n\nif ($ExportCSV -and $filtered.Count -gt 0) {\n    $filtered | Export-Csv -Path $ExportPath -NoTypeInformation -Encoding UTF8\n    Write-Host \"`nExported to: $ExportPath\" -ForegroundColor Green\n} elseif ($filtered.Count -eq 0) {\n    Write-Host \"`nNo devices found for platform: $FilterPlatform\" -ForegroundColor Green\n}\n\nWrite-Host \"`nBreakdown by OS (all platforms):\" -ForegroundColor Cyan\n$results | Group-Object OSPlatform | Sort-Object Count -Descending | Format-Table Name, Count -AutoSize\n\nDisconnect-MgGraph<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9636","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"# ?? Configuration $ExportCSV = $true $FilterPlatform = &quot;Windows11&quot; # Change to &quot;iOS&quot;, &quot;Android&quot;, &quot;macOS&quot; or &quot;&quot; for all $ExportPath = &quot;.\\DefenderNotInIntune_${FilterPlatform}_$(Get-Date -Format &#039;yyyyMMdd_HHmmss&#039;).csv&quot; # ?? Login\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"paris\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Welcome to Pariswells.com |\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Script to get list of Machines not enrolled into Intune but enrolled into Defender | Welcome to Pariswells.com\" \/>\n\t\t<meta property=\"og:description\" content=\"# ?? Configuration $ExportCSV = $true $FilterPlatform = &quot;Windows11&quot; # Change to &quot;iOS&quot;, &quot;Android&quot;, &quot;macOS&quot; or &quot;&quot; for all $ExportPath = &quot;.\\DefenderNotInIntune_${FilterPlatform}_$(Get-Date -Format &#039;yyyyMMdd_HHmmss&#039;).csv&quot; # ?? Login\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-05-11T10:39:28+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-05-11T10:39:29+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Script to get list of Machines not enrolled into Intune but enrolled into Defender | Welcome to Pariswells.com\" \/>\n\t\t<meta name=\"twitter:description\" content=\"# ?? Configuration $ExportCSV = $true $FilterPlatform = &quot;Windows11&quot; # Change to &quot;iOS&quot;, &quot;Android&quot;, &quot;macOS&quot; or &quot;&quot; for all $ExportPath = &quot;.\\DefenderNotInIntune_${FilterPlatform}_$(Get-Date -Format &#039;yyyyMMdd_HHmmss&#039;).csv&quot; # ?? Login\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#article\",\"name\":\"Script to get list of Machines not enrolled into Intune but enrolled into Defender | Welcome to Pariswells.com\",\"headline\":\"Script to get list of Machines not enrolled into Intune but enrolled into Defender\",\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"},\"datePublished\":\"2026-05-11T10:39:28+00:00\",\"dateModified\":\"2026-05-11T10:39:29+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#webpage\"},\"articleSection\":\"Research\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pariswells.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"name\":\"Research\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"position\":2,\"name\":\"Research\",\"item\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#listItem\",\"name\":\"Script to get list of Machines not enrolled into Intune but enrolled into Defender\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#listItem\",\"position\":3,\"name\":\"Script to get list of Machines not enrolled into Intune but enrolled into Defender\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"name\":\"Research\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\",\"name\":\"Welcome to Pariswells.com\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris\",\"name\":\"paris\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93b8ee3f592ac401167f870452bd82d43de80152cd3524e2853403658ada9984?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"paris\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#webpage\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender\",\"name\":\"Script to get list of Machines not enrolled into Intune but enrolled into Defender | Welcome to Pariswells.com\",\"description\":\"# ?? Configuration $ExportCSV = $true $FilterPlatform = \\\"Windows11\\\" # Change to \\\"iOS\\\", \\\"Android\\\", \\\"macOS\\\" or \\\"\\\" for all $ExportPath = \\\".\\\\DefenderNotInIntune_${FilterPlatform}_$(Get-Date -Format 'yyyyMMdd_HHmmss').csv\\\" # ?? Login\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"datePublished\":\"2026-05-11T10:39:28+00:00\",\"dateModified\":\"2026-05-11T10:39:29+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/\",\"name\":\"Welcome to Pariswells.com\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Script to get list of Machines not enrolled into Intune but enrolled into Defender | Welcome to Pariswells.com","description":"# ?? Configuration $ExportCSV = $true $FilterPlatform = \"Windows11\" # Change to \"iOS\", \"Android\", \"macOS\" or \"\" for all $ExportPath = \".\\DefenderNotInIntune_${FilterPlatform}_$(Get-Date -Format 'yyyyMMdd_HHmmss').csv\" # ?? Login","canonical_url":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#article","name":"Script to get list of Machines not enrolled into Intune but enrolled into Defender | Welcome to Pariswells.com","headline":"Script to get list of Machines not enrolled into Intune but enrolled into Defender","author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"},"datePublished":"2026-05-11T10:39:28+00:00","dateModified":"2026-05-11T10:39:29+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#webpage"},"isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#webpage"},"articleSection":"Research"},{"@type":"BreadcrumbList","@id":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/pariswells.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","name":"Research"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","position":2,"name":"Research","item":"https:\/\/pariswells.com\/blog\/category\/research","nextItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#listItem","name":"Script to get list of Machines not enrolled into Intune but enrolled into Defender"},"previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#listItem","position":3,"name":"Script to get list of Machines not enrolled into Intune but enrolled into Defender","previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","name":"Research"}}]},{"@type":"Organization","@id":"https:\/\/pariswells.com\/blog\/#organization","name":"Welcome to Pariswells.com","url":"https:\/\/pariswells.com\/blog\/"},{"@type":"Person","@id":"https:\/\/pariswells.com\/blog\/author\/paris#author","url":"https:\/\/pariswells.com\/blog\/author\/paris","name":"paris","image":{"@type":"ImageObject","@id":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/93b8ee3f592ac401167f870452bd82d43de80152cd3524e2853403658ada9984?s=96&d=mm&r=g","width":96,"height":96,"caption":"paris"}},{"@type":"WebPage","@id":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#webpage","url":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender","name":"Script to get list of Machines not enrolled into Intune but enrolled into Defender | Welcome to Pariswells.com","description":"# ?? Configuration $ExportCSV = $true $FilterPlatform = \"Windows11\" # Change to \"iOS\", \"Android\", \"macOS\" or \"\" for all $ExportPath = \".\\DefenderNotInIntune_${FilterPlatform}_$(Get-Date -Format 'yyyyMMdd_HHmmss').csv\" # ?? Login","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender#breadcrumblist"},"author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"creator":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"datePublished":"2026-05-11T10:39:28+00:00","dateModified":"2026-05-11T10:39:29+00:00"},{"@type":"WebSite","@id":"https:\/\/pariswells.com\/blog\/#website","url":"https:\/\/pariswells.com\/blog\/","name":"Welcome to Pariswells.com","inLanguage":"en-US","publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Welcome to Pariswells.com |","og:type":"article","og:title":"Script to get list of Machines not enrolled into Intune but enrolled into Defender | Welcome to Pariswells.com","og:description":"# ?? Configuration $ExportCSV = $true $FilterPlatform = &quot;Windows11&quot; # Change to &quot;iOS&quot;, &quot;Android&quot;, &quot;macOS&quot; or &quot;&quot; for all $ExportPath = &quot;.\\DefenderNotInIntune_${FilterPlatform}_$(Get-Date -Format 'yyyyMMdd_HHmmss').csv&quot; # ?? Login","og:url":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender","article:published_time":"2026-05-11T10:39:28+00:00","article:modified_time":"2026-05-11T10:39:29+00:00","twitter:card":"summary","twitter:title":"Script to get list of Machines not enrolled into Intune but enrolled into Defender | Welcome to Pariswells.com","twitter:description":"# ?? Configuration $ExportCSV = $true $FilterPlatform = &quot;Windows11&quot; # Change to &quot;iOS&quot;, &quot;Android&quot;, &quot;macOS&quot; or &quot;&quot; for all $ExportPath = &quot;.\\DefenderNotInIntune_${FilterPlatform}_$(Get-Date -Format 'yyyyMMdd_HHmmss').csv&quot; # ?? Login"},"aioseo_meta_data":{"post_id":"9636","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":{"faqs":[],"keyPoints":[],"schemas":[],"titles":[],"descriptions":[],"socialPosts":{"email":[],"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"created":"2026-05-11 10:38:55","updated":"2026-05-11 10:39:29","primary_term":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/pariswells.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/pariswells.com\/blog\/category\/research\" title=\"Research\">Research<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tScript to get list of Machines not enrolled into Intune but enrolled into Defender\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/pariswells.com\/blog"},{"label":"Research","link":"https:\/\/pariswells.com\/blog\/category\/research"},{"label":"Script to get list of Machines not enrolled into Intune but enrolled into Defender","link":"https:\/\/pariswells.com\/blog\/research\/script-to-get-list-of-machines-not-enrolled-into-intune-but-enrolled-into-defender"}],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/9636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=9636"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/9636\/revisions"}],"predecessor-version":[{"id":9637,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/9636\/revisions\/9637"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=9636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=9636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=9636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}