Skip to content

Instantly share code, notes, and snippets.

@epjuan21
Created May 30, 2024 15:57
Show Gist options
  • Save epjuan21/a292e4d6cbe94e4f94d355098e7e4e68 to your computer and use it in GitHub Desktop.
Save epjuan21/a292e4d6cbe94e4f94d355098e7e4e68 to your computer and use it in GitHub Desktop.
Move BackUp Db To HDD
$A=New-ScheduledTaskAction -Execute 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' -Argument '-File D:\ScriptsPowerShellProgramados\BackUpDbToHDD.ps1'
$T=New-ScheduledTaskTrigger -Daily -At 11:00pm
$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 "Copiar BackUp de la base de datos de Xenco Disco Duro ADATA"
Register-ScheduledTask BackUpDbToHDD -InputObject $D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment