Terminal Server or Remote Desktop Not listening on port 3389 after sysprep

Remote Desktop Services is not accepting logons because setup is running.
Log Name: Microsoft-Windows-TerminalServices-LocalSessionManager/Operational
Source: TerminalServices-LocalSessionManager
Event ID: 34

If Sysprep is stuck or trying to run repeatedly, it might be necessary to clean up any pending Sysprep state. This typically involves deleting certain registry keys and files associated with Sysprep to reset its state. Here’s how you can clean up the Sysprep run:

Steps to Clean Up Sysprep State

  1. Stop the Sysprep Process (if running):
  • Open Task Manager (Ctrl + Shift + Esc).
  • Look for any Sysprep-related processes and end them.
  1. Delete Pending Sysprep Registry Key:
  • Open the Registry Editor (type regedit in the Run dialog and press Enter).
  • Navigate to the following path:
  • Delete the GeneralizationState key.
  • You can also try GeneralizationState key value 7.
  1. Delete Sysprep Pending File:
  • Open File Explorer and navigate to the Sysprep directory:
  • Delete the Panther folder or any files in it that indicate a pending operation, such as setupact.log or setuperr.log.
  1. Clear Setup Files:
  • Navigate to the following path in File Explorer:
  • Delete the setupact.log and setuperr.log files.
  1. Check for Other Pending Operations:
  • Sometimes, other setup files can indicate pending operations. Check and delete any of the following files if they exist:
    • C:\Windows\Panther
    • C:\Windows\System32\sysprep\Panther\setupact.log
    • C:\Windows\System32\sysprep\Panther\setuperr.log
  1. Restart the Computer:
  • After cleaning up the registry and deleting pending files, restart the server.

Verify and Re-enable Remote Desktop

  1. Ensure Remote Desktop is Enabled:
  • After rebooting, check if Remote Desktop is enabled:
    • Open System Properties (Right-click on ‘This PC’ -> Properties -> Remote settings).
    • Ensure that “Allow remote connections to this computer” is selected.
    • Apply the settings.
  1. Restart Remote Desktop Services:
  • Open an elevated Command Prompt or PowerShell and run the following commands to ensure that Remote Desktop Services are running:
    powershell sc config TermService start= auto sc start TermService
  1. Check Event Viewer:
  • Open Event Viewer and navigate to Applications and Services Logs -> Microsoft -> Windows -> TerminalServices-LocalSessionManager -> Operational.
  • Verify that there are no further errors related to Sysprep or Remote Desktop Services.

Detailed Registry Edit Steps

  1. Open Registry Editor:
  • Press Win + R, type regedit, and press Enter.
  1. Navigate to Sysprep Status Key:
  • Go to HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus.
  1. Modify or Delete Values:
  • You might see a key named GeneralizationState. If it exists, right-click and delete it.

File Deletion Steps

  1. Open File Explorer:
  • Navigate to C:\Windows\System32\Sysprep\Panther.
  1. Delete Logs and Pending Files:
  • Delete any setupact.log, setuperr.log, or other pending files.


By cleaning up the Sysprep state and ensuring that Remote Desktop Services are properly configured, you should be able to resolve the issue of Remote Desktop not accepting logons. If the problem persists, further investigation into logs and potential issues with the Sysprep process or Remote Desktop configuration may be necessary.

Leave a Reply

Your email address will not be published. Required fields are marked *