Good morning, I was working on a scheduled task that would run on a user’s PC and start a particular application when the user logged into their machine and it had to run as the user in particular logging in. What I discovered was that if the user wasn’t administrator on the box I would get an access denied in both PowerShell and schtasks.
What I figured out was that if you choose to run the task at logon (I assume this probably applies to at startup as well) it requires administrative rights but if you schedule the task as an hourly, daily, weekly, etc. task it doesn’t require administrative rights to create it. Now this requires that what the task is running itself doesn’t need administrative rights but in my case it does not.
Now you may be asking yourself why didn’t he simply create a scheduled task through group policy. Well, the reason for that is I wanted it to target a specific computer collection in SCCM that targeted only laptops. I could have done it with a GPO and even filtered the GPO with WMI filtering and accomplished the same thing but the application is pushed out through SCCM and I wanted everything that went with it targeted to that collection. Maybe slightly more work on my part but good to know nonetheless.