Ensuring Applications Only Install During Autopilot Sessions

A colleague recently asked me about ensuring that applications are installed only during Autopilot provisioning and not when a regular user is logged in. This question is quite relevant in environments where it's crucial to manage the device setup process and maintain a controlled deployment atmosphere effectively.

To tackle this, one effective approach is to check for the existence of the c:\users\defaultuser* directory, which is typically present during an Autopilot session but not when a regular user is logged in. Here’s a straightforward PowerShell script that can help you set this check as a requirement rule:

This script looks for any directory starting with "defaultuser" under c:\users\. If such a directory exists, the script outputs 1 (indicating success) and exits with a status of 0, allowing the installation process to proceed. If the directory does not exist, it exits with 1, stopping the installation.

Implementing this check can help ensure that your applications are only installed during the intended phase of device setup, avoiding unauthorized installations during regular user sessions.

The application requirement rule:


要查看或添加评论,请登录

社区洞察

其他会员也浏览了