Skip to content

Instantly share code, notes, and snippets.

@epjuan21
Created May 30, 2024 16:17
Show Gist options
  • Save epjuan21/bdf4e536e3501802eef114e6c6b12e18 to your computer and use it in GitHub Desktop.
Save epjuan21/bdf4e536e3501802eef114e6c6b12e18 to your computer and use it in GitHub Desktop.
BackUpSXG5DB11AM
$A=New-ScheduledTaskAction -Execute 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' -Argument '-File D:\ScriptsPowerShellProgramados\BackUpSXG5DB.ps1'
$T=New-ScheduledTaskTrigger -Daily -At 1:00am
$U=New-ScheduledTaskPrincipal -UserId "HOSPITAL\Administrador" -LogonType ServiceAccount -RunLevel Highest
$S=New-Scheduledtasksettingsset
$D=New-ScheduledTask -Action $A -Principal $U -Trigger $T -Settings $S -Description "Ejecutar Copia de Seguridad de SXG5DB"
Register-ScheduledTask BackUpSXG5DB -InputObject $D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment