Powershell v4. Create remote task scheduler task set to expire and delete
问题 I am trying to create a task that essentially reboots the server but the task is put there by a remote server running a check to see if a reboot is needed. I am stuck trying to add an expiration so it deletes itself but can't find where to put that setting or what it is. It has to do with an end boundry or something and this setting -DeleteExpiredTaskAfter but don't know what value to put in. $dc = "server2reboot" $taskname = "Reboot $DC" $taskpath = "PendingReboots" $CimSession = New