top of page
Foto do escritorCloudDB

SQL Server - O Script Abaixo Cria Uma Tarefa No Agendador De Tarefas Do Windows

$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

203 visualizações0 comentário

Posts recentes

Ver tudo

Comments


bottom of page