Hi again! I want to set up Task Manger to run a task (spesifically a powershell script) every day at 11.00AM. I did make this script myself once but i lost it. I remember they had an example i think it was at MVA. So if anyone got that, please…
Hey i need to apply something to this thread!
I try to access my current users directory, with PowerShell in elevated mode!
I get this message: No access, permission denied
I don’t know the link between your two messages, but here is probably what you are searching for in the first one.
$Script = 'C:\MyScript.ps1' $PowerShell = 'C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe' $Action = New-ScheduledTaskAction -Execute $PowerShell -Argument "–File $Script" $Date = Get-Date -Year 2017 -Month 1 -Day 1 -Hour 0 -Minute 1 $Trigger = New-ScheduledTaskTrigger -At $Date -Daily $Settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -RunOnlyIfIdle -ExecutionTimeLimit (New-TimeSpan -Hours 1) $Principal = New-ScheduledTaskPrincipal -UserId 'NT AUTHORITY\SYSTEM' -LogonType ServiceAccount -RunLevel Highest Register-ScheduledTask -TaskName SomeStuffToDo -Description 'Explain in details' -Principal $Principal -Settings $Settings -Trigger $Trigger -Action $Action