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
- Stop the Sysprep Process (if running):
- Open Task Manager (Ctrl + Shift + Esc).
- Look for any Sysprep-related processes and end them.
- Delete Pending Sysprep Registry Key:
- Open the Registry Editor (type
regedit
in the Run dialog and press Enter). - Navigate to the following path:
HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus
- Delete the
GeneralizationState
key. - You can also try
GeneralizationState
key value 7.
- Delete Sysprep Pending File:
- Open File Explorer and navigate to the Sysprep directory:
C:\Windows\System32\Sysprep
- Delete the
Panther
folder or any files in it that indicate a pending operation, such assetupact.log
orsetuperr.log
.
- Clear Setup Files:
- Navigate to the following path in File Explorer:
C:\Windows\System32\Sysprep\Panther
- Delete the
setupact.log
andsetuperr.log
files.
- 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
- Restart the Computer:
- After cleaning up the registry and deleting pending files, restart the server.
Verify and Re-enable Remote Desktop
- 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.
- 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
- 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
- Open Registry Editor:
- Press
Win + R
, typeregedit
, and press Enter.
- Navigate to Sysprep Status Key:
- Go to
HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus
.
- Modify or Delete Values:
- You might see a key named
GeneralizationState
. If it exists, right-click and delete it.
File Deletion Steps
- Open File Explorer:
- Navigate to
C:\Windows\System32\Sysprep\Panther
.
- Delete Logs and Pending Files:
- Delete any
setupact.log
,setuperr.log
, or other pending files.
Conclusion
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.