[英]Powershell monitor task scheduler
hi i found the following ps script that stores all the results of the enabled tasks 嗨,我发现以下ps脚本存储了已启用任务的所有结果
Get-ScheduledTask | where state -EQ 'ready' | Get-ScheduledTaskInfo |
Export-Csv -NoTypeInformation -Path C:\fso\scheduledTasksResults.csv
is it possible only store tasks with no path under Taskpath which are ones i created? 是否只能在我创建的Taskpath下存储没有路径的任务?
this allows to me ensure their running okay 这可以让我确保他们的运转正常
Sure, you can add a Where-Object
Filter after the Get-ScheduledTaskInfo
just like you use after Get-Scheduledtask
full command would look like 当然,您可以在Get-ScheduledTaskInfo
之后添加一个Where-Object
过滤器,就像在Get-Scheduledtask
full命令看起来像
Get-ScheduledTask | where state -EQ 'ready' | Get-ScheduledTaskInfo | where !taskpath | Export-Csv -NoTypeInformation -Path C:\fso\scheduledTasksResults.csv
the above will find any task with a blank TaskPath
property. 上面将找到带有空白TaskPath
属性的任何任务。 However after looking at my own task scheduler it looks like you will still have a taskpath on tasks you created yourself, it will just be '\\', so in that case the correct command will be 但是,在查看了我自己的任务计划程序后,看起来您仍然拥有自己创建的任务的任务路径,它只是“ \\”,因此在这种情况下,正确的命令将是
Get-ScheduledTask | where state -EQ 'ready' | Get-ScheduledTaskInfo | where taskpath -eq '\' | Export-Csv -NoTypeInformation -Path C:\fso\scheduledTasksResults.csv
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.