{"id":8893,"date":"2025-05-20T02:40:32","date_gmt":"2025-05-20T02:40:32","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=8893"},"modified":"2026-06-06T08:29:06","modified_gmt":"2026-06-06T08:29:06","slug":"list-inactive-guest-users-in-azure-ad","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad","title":{"rendered":"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/janbakker.tech\/poor-mans-iga-monitor-and-clean-up-stale-guest-accounts\/\">Poor man\u2019s IGA: Monitor and clean up stale guest accounts &#8211; JanBakker.tech<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\"># This script requires PowerShell 7 or later for the following reasons:\n# 1. The Microsoft Graph PowerShell SDK (Microsoft.Graph module) is designed for PowerShell 7+ and may not work reliably in Windows PowerShell 5.1.\n# 2. The SignInActivity property is not returned or accessible in PowerShell 5.1 due to .NET and serialization limitations.\n# 3. Modern authentication methods used by Connect-MgGraph are only fully supported in PowerShell 7+.\n# 4. Paging and the -All switch for Get-MgUser are more reliable in PowerShell 7+.\n# 5. Microsoft is focusing new features and bug fixes for the Graph SDK on PowerShell 7+ only.\n# Attempting to run this script in Windows PowerShell 5.1 or earlier will result in errors or missing data.\n\n# Check for PowerShell 7+\nif ($PSVersionTable.PSVersion.Major -lt 7) {\n    Write-Host \"ERROR: This script requires PowerShell 7 or later. Please run it in PowerShell 7+ (pwsh.exe).\" -ForegroundColor Red\n    exit 1\n}\n\n# Check if Microsoft.Graph module is installed\n$module = Get-Module -Name Microsoft.Graph -ListAvailable\nif (-not $module) {\n    Write-Host \"Microsoft.Graph module not found. Installing...\"\n    try {\n        Install-Module -Name Microsoft.Graph -Scope CurrentUser -Force -ErrorAction Stop\n        Write-Host \"Microsoft.Graph module installed successfully.\"\n    }\n    catch {\n        Write-Host \"ERROR: Failed to install Microsoft.Graph module. Error: $_\" -ForegroundColor Red\n        exit 1\n    }\n}\nelse {\n    Write-Host \"Microsoft.Graph module is already installed.\"\n}\n\n# Import the module if not already loaded\nif (-not (Get-Command -Name Connect-MgGraph -ErrorAction SilentlyContinue)) {\n    Import-Module Microsoft.Graph -ErrorAction Stop\n}\n\n# Connect to Microsoft Graph with required scopes\nWrite-Host \"Connecting to Microsoft Graph...\"\nConnect-MgGraph -Scopes \"User.Read.All\", \"AuditLog.Read.All\", \"Device.Read.All\", \"Organization.Read.All\"\n\n# Define log file\n$logFile = \"InactiveUsersAndOldDevices_Report_$(Get-Date -Format 'yyyyMMdd_HHmmss').log\"\n\n# Dynamically retrieve the organization's primary domain\nWrite-Host \"Retrieving organization details to determine primary domain...\"\n$org = Get-MgOrganization\n$verifiedDomains = $org.VerifiedDomains\n$initialDomain = $verifiedDomains | Where-Object { $_.IsInitial -eq $true } | Select-Object -ExpandProperty Name -First 1\n$customDomains = $verifiedDomains | Where-Object { $_.IsInitial -eq $false } | Select-Object -ExpandProperty Name\n\nif ($customDomains.Count -gt 0) {\n    $orgDomain = $customDomains[0]  # Select the first custom domain as primary; adjust logic if needed for multiple domains\n} else {\n    $orgDomain = $initialDomain  # Fallback to initial domain if no custom domains exist\n}\n\nWrite-Host \"Primary domain dynamically set to: $orgDomain\"\n\n# Threshold: 6 months ago\n$inactiveThreshold = (Get-Date).AddMonths(-6)\n\n# Initialize log\nAdd-Content -Path $logFile -Value \"$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Starting Inactive Users + Old Enabled Devices Report.\"\nAdd-Content -Path $logFile -Value \"$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Primary domain: $orgDomain\"\n\n#####################################################################\n# 1. INACTIVE ENABLED USERS (6+ months no sign-in)\n#####################################################################\nWrite-Host \"Retrieving inactive enabled users...\" -ForegroundColor Cyan\n\n$allUsers = Get-MgUser -All -Property Id, DisplayName, SignInActivity, AccountEnabled, UserType, UserPrincipalName -ConsistencyLevel eventual -CountVariable userCount |\n    Where-Object {\n        $_.AccountEnabled -eq $true -and\n        $_.SignInActivity.LastSignInDateTime -and\n        ([datetime]$_.SignInActivity.LastSignInDateTime) -lt $inactiveThreshold\n    }\n\n$guestUsers = $allUsers | Where-Object UserType -eq 'Guest'\n$memberUsers = $allUsers | Where-Object UserType -eq 'Member'\n\n# Log Guest Users\nAdd-Content -Path $logFile -Value \"`n$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Inactive Guest Users (6+ months no sign-in):\"\nif ($guestUsers.Count -eq 0) {\n    $msg = \"No inactive Guest users found.\"\n    Write-Host $msg\n    Add-Content -Path $logFile -Value $msg\n} else {\n    foreach ($user in $guestUsers) {\n        $msg = \"Guest: $($user.DisplayName) | UPN: $($user.UserPrincipalName) | Last sign-in: $($user.SignInActivity.LastSignInDateTime)\"\n        Write-Host $msg -ForegroundColor Yellow\n        Add-Content -Path $logFile -Value $msg\n    }\n}\n\n# Log Member Users\nAdd-Content -Path $logFile -Value \"`n$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - Inactive Member Users (6+ months no sign-in):\"\nif ($memberUsers.Count -eq 0) {\n    $msg = \"No inactive Member users found.\"\n    Write-Host $msg\n    Add-Content -Path $logFile -Value $msg\n} else {\n    foreach ($user in $memberUsers) {\n        $msg = \"Member: $($user.DisplayName) | UPN: $($user.UserPrincipalName) | Last sign-in: $($user.SignInActivity.LastSignInDateTime)\"\n        Write-Host $msg -ForegroundColor Yellow\n        Add-Content -Path $logFile -Value $msg\n    }\n}\n\n\n#####################################################################\n# 2. OLD ENABLED DEVICES (6+ months no sign-in)\n#####################################################################\nWrite-Host \"Retrieving old enabled devices (no sign-in for 6+ months)...\" -ForegroundColor Cyan\n\n# Get all Entra ID devices\n$devices = Get-MgDevice -All -Property Id, DisplayName, ApproximateLastSignInDateTime, AccountEnabled, OperatingSystem, TrustType, ProfileType, DeviceOwnership\n\n# Filter for enabled stale devices\n$oldDevices = @()\nforeach ($device in $devices) {\n    if ($device.AccountEnabled -eq $true -and\n        $device.ApproximateLastSignInDateTime -ne $null -and\n        ([datetime]$device.ApproximateLastSignInDateTime) -lt $inactiveThreshold) {\n\n        # Get owner if available\n        $ownerUPN = \"Unknown\"\n        $ownerDisplayName = \"Unknown\"\n        try {\n            $ownerRef = Get-MgDeviceRegisteredOwner -DeviceId $device.Id -Top 1\n            if ($ownerRef) {\n                $ownerId = $ownerRef.Id\n                $owner = Get-MgUser -UserId $ownerId -Property DisplayName, UserPrincipalName\n                $ownerDisplayName = $owner.DisplayName\n                $ownerUPN = $owner.UserPrincipalName\n            }\n        } catch {\n            Write-Warning \"Failed to get owner for device $($device.DisplayName): $_\"\n        }\n\n        $oldDevices += [PSCustomObject]@{\n            DeviceName = $device.DisplayName\n            DeviceId = $device.Id\n            OperatingSystem = $device.OperatingSystem\n            TrustType = $device.TrustType\n            ProfileType = $device.ProfileType\n            DeviceOwnership = $device.DeviceOwnership\n            LastSignInDateTime = $device.ApproximateLastSignInDateTime\n            OwnerDisplayName = $ownerDisplayName\n            OwnerUPN = $ownerUPN\n        }\n    }\n}\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Poor man\u2019s IGA: Monitor and clean up stale guest accounts &#8211; JanBakker.tech<\/p>\n","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-8893","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=\"Poor man\u2019s IGA: Monitor and clean up stale guest accounts - JanBakker.tech # This script requires PowerShell 7 or later for the following reasons: # 1. The Microsoft Graph PowerShell SDK (Microsoft.Graph module) is designed for PowerShell 7+ and may not work reliably in Windows PowerShell 5.1. # 2. The SignInActivity property is not returned\" \/>\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\/list-inactive-guest-users-in-azure-ad\" \/>\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=\"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra | Welcome to Pariswells.com\" \/>\n\t\t<meta property=\"og:description\" content=\"Poor man\u2019s IGA: Monitor and clean up stale guest accounts - JanBakker.tech # This script requires PowerShell 7 or later for the following reasons: # 1. The Microsoft Graph PowerShell SDK (Microsoft.Graph module) is designed for PowerShell 7+ and may not work reliably in Windows PowerShell 5.1. # 2. The SignInActivity property is not returned\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-05-20T02:40:32+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-06-06T08:29:06+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra | Welcome to Pariswells.com\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Poor man\u2019s IGA: Monitor and clean up stale guest accounts - JanBakker.tech # This script requires PowerShell 7 or later for the following reasons: # 1. The Microsoft Graph PowerShell SDK (Microsoft.Graph module) is designed for PowerShell 7+ and may not work reliably in Windows PowerShell 5.1. # 2. The SignInActivity property is not returned\" \/>\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\\\/list-inactive-guest-users-in-azure-ad#article\",\"name\":\"List inactive Guest\\\\Users\\\\Members Users and Devices in Azure AD \\\\ Entra | Welcome to Pariswells.com\",\"headline\":\"List inactive Guest\\\\Users\\\\Members Users and Devices in Azure AD \\\\ Entra\",\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"},\"datePublished\":\"2025-05-20T02:40:32+00:00\",\"dateModified\":\"2026-06-06T08:29:06+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/list-inactive-guest-users-in-azure-ad#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/list-inactive-guest-users-in-azure-ad#webpage\"},\"articleSection\":\"Research\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/list-inactive-guest-users-in-azure-ad#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\\\/list-inactive-guest-users-in-azure-ad#listItem\",\"name\":\"List inactive Guest\\\\Users\\\\Members Users and Devices in Azure AD \\\\ Entra\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/list-inactive-guest-users-in-azure-ad#listItem\",\"position\":3,\"name\":\"List inactive Guest\\\\Users\\\\Members Users and Devices in Azure AD \\\\ Entra\",\"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\\\/list-inactive-guest-users-in-azure-ad#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\\\/list-inactive-guest-users-in-azure-ad#webpage\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/list-inactive-guest-users-in-azure-ad\",\"name\":\"List inactive Guest\\\\Users\\\\Members Users and Devices in Azure AD \\\\ Entra | Welcome to Pariswells.com\",\"description\":\"Poor man\\u2019s IGA: Monitor and clean up stale guest accounts - JanBakker.tech # This script requires PowerShell 7 or later for the following reasons: # 1. The Microsoft Graph PowerShell SDK (Microsoft.Graph module) is designed for PowerShell 7+ and may not work reliably in Windows PowerShell 5.1. # 2. The SignInActivity property is not returned\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/list-inactive-guest-users-in-azure-ad#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"datePublished\":\"2025-05-20T02:40:32+00:00\",\"dateModified\":\"2026-06-06T08:29:06+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":"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra | Welcome to Pariswells.com","description":"Poor man\u2019s IGA: Monitor and clean up stale guest accounts - JanBakker.tech # This script requires PowerShell 7 or later for the following reasons: # 1. The Microsoft Graph PowerShell SDK (Microsoft.Graph module) is designed for PowerShell 7+ and may not work reliably in Windows PowerShell 5.1. # 2. The SignInActivity property is not returned","canonical_url":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad#article","name":"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra | Welcome to Pariswells.com","headline":"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra","author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"},"datePublished":"2025-05-20T02:40:32+00:00","dateModified":"2026-06-06T08:29:06+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad#webpage"},"isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad#webpage"},"articleSection":"Research"},{"@type":"BreadcrumbList","@id":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad#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\/list-inactive-guest-users-in-azure-ad#listItem","name":"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra"},"previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad#listItem","position":3,"name":"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra","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\/list-inactive-guest-users-in-azure-ad#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\/list-inactive-guest-users-in-azure-ad#webpage","url":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad","name":"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra | Welcome to Pariswells.com","description":"Poor man\u2019s IGA: Monitor and clean up stale guest accounts - JanBakker.tech # This script requires PowerShell 7 or later for the following reasons: # 1. The Microsoft Graph PowerShell SDK (Microsoft.Graph module) is designed for PowerShell 7+ and may not work reliably in Windows PowerShell 5.1. # 2. The SignInActivity property is not returned","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad#breadcrumblist"},"author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"creator":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"datePublished":"2025-05-20T02:40:32+00:00","dateModified":"2026-06-06T08:29:06+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":"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra | Welcome to Pariswells.com","og:description":"Poor man\u2019s IGA: Monitor and clean up stale guest accounts - JanBakker.tech # This script requires PowerShell 7 or later for the following reasons: # 1. The Microsoft Graph PowerShell SDK (Microsoft.Graph module) is designed for PowerShell 7+ and may not work reliably in Windows PowerShell 5.1. # 2. The SignInActivity property is not returned","og:url":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad","article:published_time":"2025-05-20T02:40:32+00:00","article:modified_time":"2026-06-06T08:29:06+00:00","twitter:card":"summary","twitter:title":"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra | Welcome to Pariswells.com","twitter:description":"Poor man\u2019s IGA: Monitor and clean up stale guest accounts - JanBakker.tech # This script requires PowerShell 7 or later for the following reasons: # 1. The Microsoft Graph PowerShell SDK (Microsoft.Graph module) is designed for PowerShell 7+ and may not work reliably in Windows PowerShell 5.1. # 2. The SignInActivity property is not returned"},"aioseo_meta_data":{"post_id":"8893","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":"2025-12-09 21:36:06","updated":"2026-06-06 08:29:06","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\tList inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra\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":"List inactive Guest\\Users\\Members Users and Devices in Azure AD \\ Entra","link":"https:\/\/pariswells.com\/blog\/research\/list-inactive-guest-users-in-azure-ad"}],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8893","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=8893"}],"version-history":[{"count":15,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8893\/revisions"}],"predecessor-version":[{"id":9707,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8893\/revisions\/9707"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=8893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=8893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=8893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}