How can I create a scheduled task to run for any user in the “Users” group?

0
8
Asked By TechSavvyNinja42 On

I'm trying to set up a scheduled task using PowerShell that runs for all users in the "Users" group, but I'm having trouble. Right now, my script defines the task to run at logon and executes a PowerShell script from a specified path. However, instead of running under the "Users" group, it's targeting the machine name. The error I'm facing states that the task can't launch unless the specific user is logged on. Can anyone help me figure out how to make this work for any user?

3 Answers

Answered By DevGuru_88 On

Unfortunately, scheduled tasks can't run directly as a group; they need to be assigned to a specific user. One option could be to create a dedicated user account for this purpose specifically. That way you can control what it does without needing a group context.

Answered By RegistryWizard_73 On

If your script is only adding registry keys, consider directly executing those actions from the SYSTEM account. This way, you can apply the changes to all current users as well as the default profile for new accounts. You can check out tools like the PSADT for some nifty functions if you're looking for more advanced options.

Answered By ScriptMaster_42 On

I faced a similar situation once and found that using the SID for the "Users" group (S-1-5-32-545) worked for me. It allows the task to run as any member of the group. You might want to try that approach.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.