How to check/get guest user accounts which are active or disabled on Windows devices via Intune? Is there any way to pull out the results via script or GUI?

Vinod Survase 4,756 Reputation points
2023-07-10T12:42:42.43+00:00

How to check/get guest user accounts which are active or disabled on Windows devices via Intune? Is there any way to pull out the results via script or GUI?

Microsoft Intune Configuration
Microsoft Intune Configuration
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Configuration: The process of arranging or setting up computer systems, hardware, or software.
1,995 questions
Microsoft Intune Application management
Microsoft Intune Application management
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Application management: The process of creating, configuring, managing, and monitoring applications.
981 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,555 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Nick Eckermann 596 Reputation points
    2023-07-10T14:25:23.3766667+00:00

    If you are licensed for Remediations (formerly Proactive Remediations) in Intune you can run a detection script to gather the data you are looking for and once collected you can download the report and filter through it. If you are looking to disable enabled guest accounts, you can modify this to fail if in an enabled state and create a remediation script to disable guest accounts. Otherwise you can just use something like this example below for detection only.

    https://learn.microsoft.com/en-us/mem/intune/fundamentals/remediations

    
    $ReportingDetails = @()
    # Get Guest group members
    $LocalGuestUsers = Get-LocalGroup -SID S-1-5-32-546 | Get-LocalGroupMember
    # Get Guest user details
    foreach ($LocalGuestUser in $LocalGuestUsers) {
        # Get user details
        $UserDetails = Get-LocalUser -SID $LocalGuestUser.SID
        # Build user report details
        $ReportingDetails += "User: $($UserDetails.Name) Enabled: $($UserDetails.Enabled)"
    }
    # Write PAR Report
    Write-Output -InputObject ($ReportingDetails -join ', ')
    Exit 0
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.