Intune - Deploy script for newly enrolled devices

Ahmed Alshatawi 205 Reputation points
2025-02-24T22:46:03.5433333+00:00

Hello!
Is there anyway to deploy a PowerShell script for ONLY newly enrolled windows devices from Intune? Or create a dynamic group for ONLY newly enrolled devices? Thanks.

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,434 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZhoumingDuan-MSFT 16,200 Reputation points Microsoft Vendor
    2025-02-25T01:48:18.46+00:00

    @Ahmed Alshatawi, Thanks for posting in Q&A.

    Q1. Is there any way to deploy a PowerShell script for ONLY newly enrolled windows devices from Intune?

    A1. If you enroll the devices using Autopilot, you can create a PowerShell script, assign it to device group and configure Block device use until all apps and profiles are installed Yes under ESP page, after the PowerShell script will execute during the device enrollment.

    User's image

    Q2. Is there any way to create a dynamic group for ONLY newly enrolled devices?

    A2. Unfortunately, as of now there is no such thing as a property to use to filter devices based on the enrollmentDate. There are the properties available which can be used for devices while creating rules for Dynamic groups.

    https://learn.microsoft.com/en-us/mem/intune/fundamentals/filters-device-properties#device-properties

    https://learn.microsoft.com/en-us/entra/identity/users/groups-dynamic-membership#rules-for-devices

    None of the available properties can be used to create a group with enrolled devices post particular date.

    However, you can submit this feedback in our Azure feedback portal asking for this feature in the future. This channel is monitored by our PM team. They can help you in replying to your queries,

    https://feedback.azure.com/d365community/forum/22920db1-ad25-ec11-b6e6-000d3a4f0789

    Let us know if you have any further questions on this.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    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.