User Tools

Site Tools


programmazione:creare_task_schedulati

Creare task schedulati con PowerShell

Some assembly required

$Action = New-ScheduledTaskAction -Execute 'powershell' -Argument '-File c:\scripts\baubau.ps1' -WorkingDirectory 'c:\scripts\'
$Trigger = New-ScheduledTaskTrigger -Daily -At 1am
$Settings = New-ScheduledTaskSettingsSet
$Task = New-ScheduledTask -Action $Action -Trigger $Trigger -Settings $Settings  
Register-ScheduledTask -TaskName 'Baubau' -Description 'Bau bau bau' -Action $Action -Trigger $Trigger -Settings $Settings -User 'baubau' -Password 'baubau' -RunLevel Highest
programmazione/creare_task_schedulati.txt · Last modified: 5/01/2022 16:36 by lrosa