You can handle this by configuring the automation with either a time-based trigger or an activity-based trigger, depending on when you want the script to run.
If the automation uses a time-based trigger and targets a dynamic group such as all Windows devices, newly enrolled Windows devices added to that group will receive the automation when the next scheduled trigger runs.
If you need the script to run based on a device event, use an activity-based trigger instead. This is useful when the script should run after a relevant device activity rather than at a fixed schedule.
For an immediate one-time execution on a specific newly enrolled device, you can run the script manually from:
Manage > select the Windows device > Actions > Execute Custom Script
A completed one-time automation will not automatically rerun just because a new device joins the target group. For that behavior, keep the automation trigger-based rather than treating it as a one-time run.
Regards,
Mary Romero