I am trying to create the simple reboot task in multiple remote servers with the varying starttime. Here is the powershell script:
$computers = gc "c:\servers.txt"
foreach ($computer in $computers)
{
icm $computer {SchTasks /Create /SC WEEKLY /D TUE /TN “Reboot Task” /TR “shutdown /r /t 0” /ST 15:00 /RU "SYSTEM"}
}
For each computer I would like to have the different reboot time. It can be just 5 minutes added to when the loop runs every single time. So 15:00 in first server, 15:05 in second and so on. How can that be done?