Some scheduled tasks prevents migrations from occuring. This change disables tasks that are on "Ready" state before the migration to ensure migration runs without tasks preventing it.
Is there anything particularly tricky?
Checking if the tasks are disabled in the middle of the migration
How should this be tested?
Open two PWSH terminal, for migration and task check
Run this command to check the pre-migration tasks that are not Windows and Ready: Get-ScheduledTask | Where-Object { $_.TaskPath -notlike "*\Microsoft\Windows*" -and $_.State -ne "Disabled" -and $_.state -ne "Running" }
Run ADMu
In the middle of migration, check if the tasks from pre-migration check are disabled: Get-ScheduledTask | Where-Object { $_.TaskPath -notlike "*\Microsoft\Windows*" -and $_.State -eq "Disabled" }
Lastly, after the migration, check if pre-migration tasks are set to "Ready": Get-ScheduledTask | Where-Object { $_.TaskPath -notlike "*\Microsoft\Windows*" -and $_.State -ne "Disabled" -and $_.state -ne "Running" }
Issues
What does this solve?
Some scheduled tasks prevents migrations from occuring. This change disables tasks that are on "Ready" state before the migration to ensure migration runs without tasks preventing it.
Is there anything particularly tricky?
Checking if the tasks are disabled in the middle of the migration
How should this be tested?
Get-ScheduledTask | Where-Object { $_.TaskPath -notlike "*\Microsoft\Windows*" -and $_.State -ne "Disabled" -and $_.state -ne "Running" }
Get-ScheduledTask | Where-Object { $_.TaskPath -notlike "*\Microsoft\Windows*" -and $_.State -eq "Disabled" }
Get-ScheduledTask | Where-Object { $_.TaskPath -notlike "*\Microsoft\Windows*" -and $_.State -ne "Disabled" -and $_.state -ne "Running" }
Screenshots
Pre:
Mid and after migration: