Answer the question
In order to leave comments, you need to log in
Problem creating task in taskscheduler via powershell?
I noticed a strange thing: when creating a task in the task scheduler in win 10 manually through gui, everything is created without problems; Nevertheless, automating the creation of a task through powershell, I get a message - Permission denied, although I open powershell from the same user through which I created the task in the scheduler. What is the problem? How to create a task without an account request. data and windows UAC?
Task creation code:
$Trigger= New-ScheduledTaskTrigger -At 10:00am -Daily
$User= "DESKTOP123\user1"
$Action= New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "cmd.exe"
Register-ScheduledTask -TaskName "StartupScript_PS" -Trigger $Trigger -User $User -Action $Action -RunLevel Highest –Force
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question