Reputation: 53
I am trying to get list of scheduled tasks from some remote machines using the get-scheduledTasks
cmdlet. How to list those tasks and filter out only few tasks out of them and perform actions based on the presence of those tasks
Upvotes: 0
Views: 742
Reputation: 81
$name="Start of task name or absolute name"
$servers="server01","server02","server03"
$tasks = $servers | % { Invoke-Command -ComputerName $_ -ScriptBlock { Get-ScheduledTask | ? { $_.Name.StartsWith($name) } }
What you then do depends on what you want to do with those tasks.
Upvotes: 1