How to detect if a device is in Autopilot installation

Betz, Dominik 16 Reputation points
2022-11-18T14:45:44.123+00:00

Hi there,

we are using PSAppDeployToolkit for our app installations. Therein we have a check on whether the script is running in Autopilot or not. We use the the following code to detect if Autopilot is active:

        $IsCloudExperienceHostBrokerRunning=(@(Get-Process CloudExperienceHostBroker -ErrorAction SilentlyContinue)).count -gt 0  
        [bool]$IsRunningInAutopilot =($IsCloudExperienceHostBrokerRunning -eq $true) -and (-not (Get-CimInstance -Namespace 'root\cimv2\mdm\dmmap' -ClassNam 'MDM_EnrollmentStatusTracking_Setup01' -ErrorAction Stop | Select-Object -ExpandProperty HasProvisioningCompleted))  

Unfortunately since a few weeks the check doesn't work anymore because the process CloudExperienceHostBroker doesn't exist anymore. Does anyone have a good idea how to detect it now?

Thanks in advance.

Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,949 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.
961 questions
Microsoft Intune Enrollment
Microsoft Intune Enrollment
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Enrollment: The process of requesting, receiving, and installing a certificate.
1,377 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Rahul Jindal [MVP] 10,196 Reputation points MVP
    2022-11-18T15:42:48.917+00:00

    Is the requirement to ensure the apps install on Autopilot provisioned devices? If yes, then have you considered using device filters instead?

    0 comments No comments

  2. Betz, Dominik 16 Reputation points
    2022-11-21T05:41:07.17+00:00

    We are working in a co-managed environment where the apps can be installed by the following means:

    1. During Autopilot
    2. During a SCCM Task sequence
    3. From company portal using either SCCM or Intune.

    How would the implementation with device filters work?

    Thanks in advance

    0 comments No comments

  3. Justin Dybedahl 0 Reputation points
    2024-01-23T20:12:07.42+00:00

    I know this is an old topic but wondering if there has been a solution found on this?


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.