Goal, Read the value of the scheduled task, the one that sync groups policy and project at what time the task will run every day by reading the task triggers. $TaskGpUpdateComp = get-scheduledtask -Taskpath "\Microsoft\Windows\GroupPolicy" -TaskName “{3E0A038B-D834-4930-9981-E89C9BFF83AA}” | select -ExpandProperty Triggers
ok thanks I had a look at link and decide it was too complex for me so did something at my skill level used a regex match here is final code, its reads the 1st run time for GPO Scheduled task then project into the future at what time the task should run.
#Project the time at which GPO update computer will run. $count = 0 do { if ($count -eq 0) {$nextProcessing = $StartTime; write-host “GPO processing at $nextProcessing” }
$nextProcessing += ($TimeSpan) write-host “GPO processing at $nextProcessing” $count++ }
until ( $nextProcessing -ge $(get-date) )
the output from my PC
GPO processing at 12/02/2019 07:48:52
GPO processing at 12/02/2019 09:34:52
GPO processing at 12/02/2019 11:20:52
GPO processing at 12/02/2019 13:06:52
GPO processing at 12/02/2019 14:52:52
GPO processing at 12/02/2019 16:38:52
GPO processing at 12/02/2019 18:24:52
GPO processing at 12/02/2019 20:10:52
GPO processing at 12/02/2019 21:56:52
GPO processing at 12/02/2019 23:42:52
GPO processing at 12/03/2019 01:28:52
GPO processing at 12/03/2019 03:14:52
GPO processing at 12/03/2019 05:00:52
GPO processing at 12/03/2019 06:46:52
GPO processing at 12/03/2019 08:32:52
GPO processing at 12/03/2019 10:18:52
GPO processing at 12/03/2019 12:04:52
GPO processing at 12/03/2019 13:50:52
GPO processing at 12/03/2019 15:36:52
GPO processing at 12/03/2019 17:22:52
GPO processing at 12/03/2019 19:08:52
GPO processing at 12/03/2019 20:54:52
GPO processing at 12/03/2019 22:40:52
GPO processing at 12/04/2019 00:26:52
GPO processing at 12/04/2019 02:12:52
GPO processing at 12/04/2019 03:58:52
GPO processing at 12/04/2019 05:44:52
GPO processing at 12/04/2019 07:30:52
GPO processing at 12/04/2019 09:16:52
GPO processing at 12/04/2019 11:02:52
GPO processing at 12/04/2019 12:48:52