[PSM] - Session Logoff Fails with "Your Remote Desktop Services session has ended" or PSMSR948W / 947E / 946E Session Keeper Errors
Symptom
When a user logs off or attempts to disconnect from a target server via PSM, one or more of the following symptoms occur:
Scenario 1 (Client On-Screen Pop-Up):
The RDP window abruptly terminates with the message:
"Your Remote Desktop Services session has ended. You were logged off the remote computer. Your network administrator or another user might have ended your session. Try connecting again, or contact technical support for assistance."
Scenario 2 (PSM Trace / Console Log Errors):
The PSM logs (`PSMTrace.log` / `PSMConsole.log`) record the following error messages:
- PSMSR948W [xxxxx] Session keeper did not logoff the session. The session will be forcefully logged off. (Session id: X). Reason: 947E [xxxxx] Failed to send stop command to the session keeper, session keeper is not accessible.
- PSMSR948W [xxxxx] Session keeper did not logoff the session. The session will be forcefully logged off. (Session id: X). Reason: 946E [xxxxx] Session keeper logoff timeout reached while waiting for the session to logoff.
- PSMSR126E [] Failure occurred while handling session. PSMSC036E No Process was found for image [PSMInitSession.exe]
Environment
14.2;14.6;15.0;14.7;14.8;15.2 Privileged Access Manager (PAM, self-hosted) PSM
- Products: Privileged Access Manager (PAM, self-hosted), Privilege Cloud
- Components: Privileged Session Manager (PSM)
- Process / Subsystem: PSM Session Keeper (`PSMInitSession.exe`)
- Affected Versions: Idira PAM v14.x, v15.x
Cause
When a PSM session is closed, the PSM Session Keeper component (`PSMInitSession.exe`) coordinates session teardown and logoff with the remote desktop host.
If target application processes or profile unloads take longer than the configured timeout thresholds, PSM forcefully terminates the session pipeline, producing logoff error warnings and the Remote Desktop Services disconnect message.
Resolution
To allow sufficient time for clean session teardown, increase the Session Keeper timeout configurations in PVWA and on the PSM server:
Step 1: Increase Timeout Settings in PVWA
1. Log in to PVWA as an Administrator.
2. Navigate to: Administration > Options > Privileged Session Management > General Settings > Session Settings > Advanced Settings.
3. Modify the following parameters:
- `SessionKeeperShutdownTimeout`: Increase from `500` to `50000` (milliseconds).
- `InitSessionTimeout`: Increase from `15` to `30` (seconds).
4. Click Apply and OK to save changes.
Step 2: Increase Timeout Setting on the PSM Server
1. Log on to each PSM server as an Administrator.
2. Navigate to the PSM Components directory (Default path: `C:\Program Files (x86)\CyberArk\PSM\Components`).
3. Open `Conf.xml` in a text editor (e.g., Notepad).
4. Locate the `<Timeout>` tag and set its value to `30000` (milliseconds):
<Timeout>30000</Timeout>
5. Save and close `Conf.xml`.
Step 3: Apply Configuration Changes
Changes take effect automatically based on the `ConfigurationRefreshInterval` (Default: 10 minutes). To apply changes immediately, restart the Idira Privileged Session Manager service (`CAPSM`) on each PSM server:
- Open `services.msc`, right-click "Idira Privileged Session Manager", and select Restart.