Unable to make RDP connections to the PSM server and sessions fail with ‘PSMSC036E'

Unable to make RDP connections to the PSM server and sessions fail with ‘PSMSC036E'

377
Created On 11/10/26 11:01 AM - Last Modified 11/10/26 15:54 PM


Symptom



After some days, following a reboot of the PSM server, users consistently face ‘PSMSC036E No Process was found for image [PSMInitSession.exe]’ when trying to establish sessions. Also, an administrator trying to access the server via a direct RDP connection may find they are unable to connect. Sometimes, it's possible to connect using mstsc.exe with the ‘/admin’ switch, but not always, and so a power reset is required.
 

Additional details can be found in the article: https://community.cyberark.com/s/article/PSM-needs-to-be-regularly-rebooted
 



Environment


11.7;12.2;12.6;13.0;13.2;14.2 Privileged Access Manager (PAM, self-hosted) PSM
  • Privileged Session Management (PSM)
  • PSM Connection via PVWA


Cause



It has been discovered, largely through the use of RemoteApp, that some registry keys accumulate a significant number of entries and continue to grow until they reach predefined limits (a little under 2GB), causing the registry to 'bloat'. This bloating can cause a lock-out of RDP connections due to applications not being able to write to the affected registry keys at logon.
 
The issue has been traced to the following keys:
 
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\VolatileNotifications
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Notifications
  • HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Deployment\Package\*\ (Server 2019 only)


Resolution



To address the issue effectively, ALL steps below must be completed:

1. VolatileNotifications
 
To address the issue with ‘VolatileNotifications’ bloating in the registry please ensure Microsoft KB5032016 (Released - November 23) is installed on the PSM server (Server 2019 only)
 
This patch needs to be activated by adding the following registry entry then reboot the server:
 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\Microsoft\FeatureManagement\Overrides
DWORD = 857197709
Value = 1

Note1: KB5032196 is a Cumulative Update and has been replaced by subsequent updates, please check the link below for all updates which replace this update.

https://www.catalog.update.microsoft.com/ScopedViewInline.aspx?updateid=28babb9b-6ca0-47e1-9fd1-549c1e895625

Note2: This update is applicable to Server 2019 only. Microsoft has confirmed that Server 2016 will not receive patches as it has reached End of Life (EOL) and is now in Extended Support.

In cases where Server 2016 is used, and therefore no patch is available, the official solution is to reboot the server. One option to consider, but is NOT officially supported, is to setup a script to regularly delete the contents of the 'VolatileNotifications' key. Please see the 'Notes' section at the bottom of this article for more information. 
 
 
2. Notifications
 
To resolve the issue of 'Notifications' bloating in the registry, implement the following five Group Policy Objects (GPOs):

(GPEdit.msc -> Computer Configuration -> Administrative Templates -> System -> Device Installation)
 
1. Prevent device metadata retrieval from the Internet -> Set to ‘Enabled’
2. Specify search order for device driver source locations -> Set to ‘Enabled’ and choose ‘Do not search Windows Update’
 
(GPEdit.msc -> Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Session Time Limits):
 
3. Set time limit for disconnected sessions -> Set to ‘Enabled’ and choose ‘1 minute’ (or a preferred value)
4. End session when time limits are reached -> Set to ‘Enabled’
5. Set time limit for logoff of RemoteApp sessions -> Set to ‘Enabled’ and choose ‘Immediately’
 
Please run 'gpupdate /force' from an administrative Command Prompt after making changes. Microsoft suggest a system reboot having applied the first two GPO's.


3. Delete SID for PSMConnect user under Package\* key (Server 2019 only and later)

There are two scripts provided below. 'Script1' for use with Local PSMConnect user accounts and 'Script2' for use with Domain based PSMConnect user account. Please ensure you use the correct script otherwise it will be ineffective.

Copy the relevant script text below and save as ‘delete.ps1’ in ‘C:\Script\’ – Note, you can change the file name and path as needed but the instructions provided here are based on these names and paths, therefore they would need to be changed accordingly:


Script1 - for use with 'Local' PSMConnect user accounts:

 
 # Create a log in the Documents folder for the user who logs off
 # Start-Transcript

 # Define username
 $username = "PSMConnect"

 # Find local user
 $user = Get-LocalUser -Name $username

 # Check if user was found
 if ($user) {
    # Get the SID from the local user object (SID property)
    $UserSID = $user.SID

    # Delete user-specific registry key (same logic as before)
    $RegPath = "HKLM:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Deployment\Package\*\$UserSID"

    if (Test-Path $RegPath) {
        Remove-Item $RegPath -Recurse -Force
        Write-Host "Registry key deleted successfully for user '$username' (SID: $UserSID)"
    } else {
        Write-Host "The registry key for the user SID $UserSID does not exist."
    }


  # Stop-Transcript

Script2 - for use with 'Domain' PSMConnect user accounts:
 
# Create a log in the Documents folder for the user who logs off
# Start-Transcript

# Define username
$username = "PSMConnect_Username"

# Find user SID
$wmiObj = Get-WmiObject -Class Win32_UserAccount -Filter "Name='$username'"

if ($wmiObj) {
    $userSID = $wmiObj.SID
    Write-Host "The SID for user $username is: $userSID"

    # Delete user-specific registry key
    $RegPath = "HKLM:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Deployment\Package\*\$userSID"

    if (Test-Path $RegPath) {
        Remove-Item $RegPath -Recurse -Force
        Write-Host "Registry key deleted successfully for user '$username' (SID: $userSID)"
    } else {
        Write-Host "The registry key for the user SID $userSID does not exist."
    }
} else {
    Write-Host "User '$username' not found."
}

# Stop-Transcript


NOTE: For initial testing uncomment (remove the '#'') from the beginning of these two lines in the scripts above:

# Start-Transcript
# Stop-Transcript

This creates a log file in the 'Documents' folder for the 'PSMConnect' user (typically C:\Users\<PSMConnect_username>\Documents). This is helpful initially to confirm the script has executed successfully, simply because the log file exists. Alternatively, check the registry immediately after the script has been executed and confirm the SID key has been deleted or, if it does exist, contains a minimal amount of subkeys.


Instructions:

All steps are carried out on the affected PSM server(s).
  1. Create a new directory for the Script to be saved to, e,g, 'C:\script\’.
  2. Copy the Microsoft PowerShell Script to the folder created in the previous step.
  3. Open the Delete.ps1 script in notepad and ensure the following variable is set correctly on line 2. This must match the username of your Local or Domain PSMConnect user. For example a local PSMConnect user would typically be as below (precede this with your domain name and a backslash '\' if using a domain account):
$username = "PSMConnect"
 
 
Configure Task Scheduler to run the script:

All steps are carried out on the PSM server and will need to be repeated on additional PSM servers.

 
  1. Configure a Scheduled Task to run the delete.ps1 script:
    1. Run taskschd.msc
    2. Create a new task
    3. Under the General tab (see screenshot below)
      1. Provide a name (e.g. ‘Delete PSMConnect SID’)
      2. Configure the task to run as SYSTEM
      3. Select Run with highest privileges
      4. Set Configured for: Server 2019 if running on Server 2019 or later (otherwise leave as is)
    4. Under the Trigger tab (see screenshot below)
      1. Set Begin the task: 'On a schedule'
      2. Select 'Daily', set the time (e.g. 02:00am) and 'Recur every: 1 days'
      3. Select 'Stop task if it runs longer than: 30 minutes' and select “Enabled”
    5. Configure the Actions (see screenshot below)
      1. Action: “Start a Program”
      2. Program/Script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
      3. Add Arguments: -File "C:\script\delete.ps1"
    6. Click Ok and save the task

General Tab:
image.png

Trigger Tab:
image.png

Action:
image.png

After the script has executed at the scheduled time (or run manually) the SID for the PSMConnect user should be deleted from the following key:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Deployment\Package\*



Tip: How to identify the PSMConnect users SID:

To identify a user's SID, for example, when needing to determine the SID for the domain PSMConnect user, you can run the following PowerShell command on the Domain Controller:

Get-ADUser -Identity "<Domain_Username>"

Alternatively, for local (or domain) PSMConnect accounts, check this registry location on the PSM:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\ProfileList

Under this key you will find SID’s for users who login to the PSM. Under each SID check the ‘ProfileImagePath’ until you find the correct path for your PSMConnect user. Be careful that when using this method, if you are using domain accounts the path 'C:\Users\PSMConnect' is very likely to be for the default ‘local’ PSMConnect user and not your domain PSMConnect user.
 
4. SessionID’s (Optional step)
 
This is not an essential step but to assist with the recycling of Session ID’s add the following registry entry and reboot the server:
 
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Kernel
DWORD = SeTokenDoesNotTrackSessionObject
Value = 1
 
Optional workaround:

The alternative to applying all of the above changes are:

 
(i) Reboot the PSM server on a schedule that is more frequent than the time it takes for the issue to occur
(ii) Disable RemoteApp

Notes:


Disabling RemoteApp does not fix the issue entirely but reduces the bloating to a level where the PSM needs to be rebooted far less frequently (e.g. months rather than weeks).
 
If the above update cannot be applied, such as where Server 2016 is used, the only solution is to reboot the server on regular intervals, such as weekly or bi-weekly (restarting the PSM service typically does not help). You may wish to consider manually removing the ‘VolatileNotification’ entries from the registry, or automate this process with a scheduled script. Please be advised this solution is NOT officially supported and PERFORMED AT YOUR OWN RISK. It is important to delete the entries before the issue occurs as it can be difficult to recover the server once the issue is apparent. Running a scheduled task daily, and preferably in out of business hours, should be sufficient.

The recommended solution is to upgrade the Server OS to Server 2022 and your PSM software to a current version.

 

 
 


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000thMCAQ&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail