[PSM] - Sessions Terminate Immediately or Time Out Due to Dell KACE Agent (KUsrInit.exe)
Symptom
During PSM session initiation, users experience one of the following two failure scenarios:
Scenario 1: Session Closes Immediately During Initial Logon (AppLocker Block)
- The PSM session opens and immediately closes before the target application loads.
- The PSM trace logs record:
PSMSR504W [sessionID] An exception occurred during the session flow's exception handling procedure (Handling stage: [DisplayErrorNotification], Internal exception: [PSMSC050E Failed to get user token of TS session [ID] (System error [2]: The system cannot find the file specified.)])
PSMSR126E [sessionID] Failure occurred while handling session. PSMSC036E No Process was found for image [PSMInitSession.exe], session ID (Codes: -1, -1)
- The Windows Application Event Log records:
"The Windows logon process has failed to spawn a user application. Application name: . Command line parameters: C:\Windows\system32\KUsrInit.exe."
Scenario 2: Session Connects but Terminates on Timeout (Duplicate Process Launch)
- The session connects, but an on-screen dialog prompts:
"Timeout has expired, User being disconnected."
- Process Monitor (Procmon) or trace analysis reveals that `PSMInitSession.exe` was spawned twice in the same session. PSM kills the initial instance, while the secondary unmanaged instance times out and forces the session to disconnect.
Environment
14.2;14.6;15.0;14.7;14.8;15.2 Privileged Access Manager (PAM, self-hosted);Privilege Cloud Privileged Session Management (PSM);Privilege Cloud PSM
- Products: Privileged Access Manager (PAM, self-hosted), Privilege Cloud
- Components: Privileged Session Manager (PSM), PSM Session Keeper (PSMInitSession.exe)
- Third-Party Software: Dell KACE Agent (KUsrInit.exe)
- OS Subsystem: Windows Winlogon (Userinit), AppLocker
- Supported Versions: v14.x, v15.x
Cause
The Dell KACE Agent replaces or chains the default Windows logon executable (`userinit.exe`) with its own custom executable (`C:\Windows\system32\KUsrInit.exe`) under `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit`.
1. **AppLocker Block:** By default, Idira PSM AppLocker rules permit `userinit.exe` but do not whitelist `KUsrInit.exe`. When Windows attempts to spawn `KUsrInit.exe` for the `PSMConnect` user, AppLocker blocks execution, preventing `PSMInitSession.exe` from ever launching.
2. **Duplicate Process Chaining:** If the registry string contains chained entries (e.g., `userinit.exe,KUsrInit.exe,`) or if `KUsrInit.exe` invokes `userinit.exe` a second time, `PSMInitSession.exe` is triggered twice. PSM's session broker only supports a single session instance per connection.
Resolution
Apply one of the following resolution methods depending on whether Dell KACE is required on the PSM server:
Method A: Restore Default Windows Userinit Registry Value
Because Idira PSMs are dedicated, hardened bastion servers, third-party desktop management agents that modify core OS logon binaries are not recommended.
1. Log on to the PSM server as a local Administrator.
2. Open Registry Editor (`regedit.exe`).
3. Navigate to:
`HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon`
4. Locate the string value named `Userinit`.
5. Ensure the value is set strictly to the Windows default (including the trailing comma):
Value Name: Userinit
Value Data: C:\Windows\system32\userinit.exe,
6. If `C:\Windows\system32\KUsrInit.exe` is present as a secondary or chained entry, remove it.
7. (Recommended) Disable or uninstall the Dell KACE Agent from the PSM server to prevent future GPOs or management tasks from overwriting this key.
Method B: Whitelist KUsrInit.exe in AppLocker (If Dell KACE Must Remain)
If corporate policy mandates keeping the Dell KACE Agent active on the PSM server:
1. Verify the `Winlogon\Userinit` registry value contains only a single entry:
`C:\Windows\system32\KUsrInit.exe,`
(Ensure it is not chained with `userinit.exe`, which causes duplicate process execution).
2. Open `C:\Program Files (x86)\CyberArk\PSM\Hardening\PSMConfigureAppLocker.xml` in an elevated text editor.
3. Locate the `<Processes>` section.
4. Below the existing entry for `UserInit`, add an entry for `KUsrInit`:
<Application Name="KUsrInit" Type="Exe" Path="C:\Windows\System32\KUsrInit.exe" Method="Hash" />
5. Save and close `PSMConfigureAppLocker.xml`.
6. Open PowerShell as Administrator, navigate to `C:\Program Files (x86)\CyberArk\PSM\Hardening`, and run:
.\PSMConfigureAppLocker.ps1
7. Test a new PSM connection from PVWA.
Additional Information
Details
Symptom:- PSMSR504W [sessionID] An exception occurred during the session flow's exception handling procedure (Handling stage: [DisplayErrorNotification], Internal exception: [PSMSC050E Failed to get user token of TS session [4] (System error [2]: The system cannot find the file specified.)])
- PSMSR126E [sessionID] Failure occurred while handling session. PSMSC036E No Process was found for image [PSMInitSession.exe], session 4 (Codes: -1, -1)
- The Windows logon process has failed to spawn a user application. Application name: . Command line parameters: C:\Windows\system32\KUsrInit.exe.