I've downloaded the powershell script located here: http://gallery.technet.microsoft.com/scriptcenter/Get-Scheduled-tasks-from-3a377294
However, this doesn't give me the piece of info I'm looking for. i want to see if any task is set to wake the pc in order to run that task. I see where in the script it's looping through and displaying the properties for each task. But I'm not familiar with working with powershell or the Schedule.Service object so i don't know what property that is. Could someone eithe tell me a way to get a list of tasks set to wake the pc? or just tell me how to edit that script so it displays that bit of info.
thanks
Use Task SchedulerGo to the Start menu search bar, type in 'task scheduler,' and select the best match. In the Task Scheduler, click on Action > Create Task… Set a name for your task. We'll set the name as 'wake up'.
To retrieve the existing tasks in the task scheduler using PowerShell, we can use the PowerShell command Get-ScheduledTask. We can use the Task Scheduler GUI to retrieve the scheduled tasks. To retrieve using PowerShell, use the Get-ScheduledTask command.
Wake Your PC Automatically Using the Task Scheduler. You can configure your PC to wake automatically using a Windows app called the Task Scheduler. Type Task Scheduler in the Windows Search Bar and select the Best Match. In the right-hand side panel of the Task Scheduler window, click Create Task.
If you open Event Viewer and go to: Event Viewer (Local) / Applications and Services Logs / Microsoft / Windows / TaskScheduler / Optional, you will see all the Task Histories.
This can be done in a one-liner:
Get-ScheduledTask | where {$_.settings.waketorun}
Get-ScheduledTask is available in Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2.
on win8.1:
$tasks = Get-ScheduledTask
ForEach ($task in $tasks)
{
if($task.settings.waketorun -eq 'True')
{"$($task.taskname)"}
}
That information should be down in the xml.
Edit: Graimer is correct that this is not using the same script that was linked.
This uses Get-ScheduledTask from the TaskScheduler Module in the PowerShellPack, which can be downloade from here:
http://archive.msdn.microsoft.com/PowerShellPack
$tasks = Get-ScheduledTask -ComputerName <ComputerName>
ForEach ($task in $tasks)
{
$xml = [xml]$task.xml
if ($xml.task.settings.waketorun -eq 'True')
{ "Task $($task.name) is set to WakeToRun" }
}
or simply
Get-ScheduledTask | select TaskName,TaskPath,@{name="Aufweckung.";expression={$_.Settings.WakeToRun}} -ExpandProperty Triggers | ft -AutoSize -Wrap
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With