PowerTip: Find all the Azure Automation jobs that will run in the next two days

The Scripting Guys

Dr Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to find all the Azure Automation jobs that will run in the next two days.

Hey, Scripting Guy! Question Is there a way to find all the Azure Automation jobs that will run in the next two days?

Hey, Scripting Guy! Answer Use the Get-AzureAutomationSchedule cmdlet, and check out the NextRun attribute. Here is an example:

Get-AzureRmAutomationSchedule -ResourceGroupName $ResourceGroupName -AutomationAccountName $AutomationAccountName | Where NextRun -lt $(Get-Date).AddDays(2)

The Doctor

The Scripting Guys
Dr Scripto

Follow Dr Scripto   

No Comments.