The command to get schedule task details in PowerShell is `Get-ScheduledTask`. This command retrieves the scheduled task details like TaskPath, TaskName, and State.
Get-Scheduled lists all scheduled task that is scheduled on a computer.
In this article, we will discuss how to get scheduled task details and get details about a scheduled task in PowerShell.
Retrieve Scheduled Task Details in PowerShell
Use the PowerShell command Get-TaskScheduler to retrieve existing scheduled task details.
Get-ScheduledTask
In the above PowerShell script, the Get-ScheduledTask cmdlet list all scheduled tasks details and displays task details.
The output of the above PowerShell script to view scheduled tasks is:
![Get Scheduled Task Information in PowerShell Get Scheduled Task Information in PowerShell](https://shellgeek.com/wp-content/uploads/2023/02/get-scheduled-task-details-powershell.png)
Cool Tip: How to get scheduled task action details in PowerShell!
How to Get Details about a Scheduled Task in PowerShell?
Use the Get-ScheduledTask cmdlet with the where
clause to get details about a scheduled task in PowerShell.
Get-ScheduledTask | Where {$_.TaskName -eq "UserAccountTests"}
In the above PowerShell script, the Get-ScheduledTask cmdlet gets the information about a scheduled task where the TaskName
is equal to "UserAccountTests"
. It uses the Where
cmdlet to check the TaskName using the -eq
operator.
The output of the above PowerShell script shows scheduled task information about a task like a task path, task name, and task state.
![Get Information about a Scheduled Task in PowerShell Get Information about a Scheduled Task in PowerShell](https://shellgeek.com/wp-content/uploads/2023/02/get-details-of-a-scheduled-task-powershell.png)
Cool Tip: How to disable scheduled tasks using PowerShell!
Conclusion
I hope the above article on how to get scheduled task details in PowerShell using the Get-ScheduledTask cmdlet is helpful to you.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.