Install a script for each user who logs in using MECM.

iBuildEngineer 26 Reputation points
2022-06-28T22:19:12.247+00:00

Hello everyone.

I'd want to execute a PowerShell script for each User who logs onto a device.
I created a deployment with an application model, sent it to a device-based collection, and configured the detection logic to HKCU.
Install for User is the deployment behavior. Because my detection logic looks at HKCU, I believe the script will execute for every logged-in User.

Or should I direct it to an user-specific collection?

Microsoft Configuration Manager Application
Microsoft Configuration Manager Application
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Application: A computer program designed to carry out a specific task other than one relating to the operation of the computer itself, typically to be used by end users.
475 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rita Hu -MSFT 9,626 Reputation points
    2022-06-29T07:38:43.907+00:00

    @iBuildEngineer
    Thanks for your posting on Q&A.

    To avoid misunderstanding, I would like to confirm the requirement first before moving on. You want to deploy the specific PowerShell script for every Users who logon onto a device. Right? Would you mind sharing your requirement in detail? I would like try to test it in my lab first.

    In theory, the users who are included into the user-specific collection will execute a PowerShell script if you set the Detect Method as HKCU and deploy the application into the User Collection when they logon the CM client device.

    Best regards,
    Rita


    If the answer is the right solution, 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.