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 [...] read more
This script works great from my workstation during testing. It grabs the username disable date time and enable date and time from a CSV then creates a scheduled task to expire the account during a specific lockout time. It will then unlock the account during the enable process. I have [...] read more
I am trying to create a scheduled task using PowerShell 5. But I'm getting an error while trying especially with adding DeleteExpiredTaskAfter to ScheduledTaskSettingsSet > -DeleteExpiredTaskAfter (New-TimeSpan -Seconds 120) The PowerShell script below: $taskname = "Test01" $taskdescription = "Testing" $taskpath = "\Test" $action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument '-NoProfile -WindowStyle [...] read more