请如何获取计划任务以及如何使用PowerShell从远程服务器启用它们
答案 0 :(得分:0)
您可以使用Task Scheduler Scripting Objects:
$ComputerName = 'remotemachine.domain.tld'
$TaskName = 'Name of disabled task'
$TaskScheduler = New-Object -ComObject Schedule.Service
$TaskScheduler.Connect($ComputerName)
$ScheduledTask = TaskScheduler.GetFolder('\').GetTask($TaskName)
$ScheduledTask.Enabled = $True