MDT Task Sequence Hangs when using Terminal app

Task Sequence hangs (waits) installing an application until the mouse is clicked.

Adding the below PowerShell script to the start of the MDT deployment will force the client to use the old-school text window instead of the modern Windows Terminal app. It is often used by system builders to fix script errors or script frezzing.

Write-Host "Set the default terminal app to Console Host"
# This prevents scripts from unexpectedly aborting when/if the Terminal App gets updated while they are running. This may also prevent the rare, random problem of MDT Application installation PowerShell scripts not launching until mouse activity is detected.

New-Item -Path "HKCU:\Console" -Name "%%Startup" -ErrorAction Ignore | Out-Null

Set-ItemProperty -Path "HKCU:\Console\%%Startup" -Name "DelegationConsole" -Value "{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}" -Type String

Set-ItemProperty -Path "HKCU:\Console\%%Startup" -Name "DelegationTerminal" -Value "{B23D10C0-E52E-411E-9D5B-C09FDF709C7D}" -Type String

Script source –
Task Sequence hangs (waits) installing an application until I move the mouse or click : r/MDT

Reset RDS Grace Period – Terminal Service

Steps to reset Remote Desktop Services

Licensing notification

Open Regedit and go to the ‘GracePeriod’ key shown below.

GracePeriod key

Give the local Administrators group ‘Full Control’ of the ‘GracePeriod’ key. It’s assumed you are a member of the local Administrators group.

Permissions for the GracePeriod key

Delete the binary data highlighted in the second image.

Reset Grace Period

Reboot the server or restart the Terminal Service.

Modify Registry Using Command-line

Modify the registry without prompts – suitable for use with batch files. Run with elevated privileges.

reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\etc\etc /v Valuename /t REG_SZ /d valuedata /f

/v Value : The value name eg ProgId

/t DataType : REG_SZ (default) | REG_DWORD | REG_EXPAND_SZ | REG_MULTI_SZ

/d Data : The actual data to store as a “String”, integer etc

/f Force: Force an update without prompting “Value exists, overwrite Y/N”