$A = New-ScheduledTaskAction -execute "powershell" -argument "-nologo -noprofile -noninteractive C:\Server\monitora_disco.ps1"
$hourly = (New-TimeSpan -Minutes 5)
$dt= ([DateTime]::Now)
$duration = $dt.AddYears(25) -$dt;
$T = New-ScheduledTaskTrigger -Once -At (Get-Date).Date -RepetitionInterval $hourly -RepetitionDuration $duration
Register-ScheduledTask -TaskName monitora_disco -Trigger $T -Action $A -description "SCRIPT_VERIFICA_SERVIDOR" -User "NT AUTHORITY\SYSTEM" -RunLevel 1
Set-ScheduledTask monitora_disco -Trigger $T
Comments