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
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.
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.
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
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures