PSM - Windows Server Registry Bloating issue

PSM - Windows Server Registry Bloating issue

262
Created On 11/10/26 11:03 AM - Last Modified 11/10/26 15:56 PM


Symptom



This article is intended as a follow-on from the article ‘PSM Server needs to be regularly rebooted’:
https://community.cyberark.com/s/article/PSM-needs-to-be-regularly-rebooted.


It is aimed to further assist customers with identifying they’re affected by this issue as well as help to provide the relevant information when raising a case with Microsoft.

If identified as an issue it is important to raise a case directly with Microsoft Support to assist with highlighting the extent of the problem. The more cases raised, the increased likelihood there is of receiving increased priority and attention to this matter. In addition, it’s possible you’ll receive a solution prior to it being publicly available, this can otherwise take several months.

The 'Resolution' section of this article has been divided into two sections:

     Section 1: Collecting information from the PSM for assisting Idira investigations
     Section 2: Preparing information for a Microsoft Support case

 


Environment


11.7;12.2;12.6;13.2 Privileged Access Manager (PAM, self-hosted);Privilege Cloud PSM

Cause



Three Registry locations have been identified to cause a resource issue through registry ‘bloating’ which can result in the Windows OS becoming slow and unresponsive for RDP connections. These are as follows:
 
  • 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\*\

We understand the problem occurs because there is a 2 GB size limit for some registry hives that is being reached. Whilst is it possible to increase this limit it can lead to additional problems and so the aim is to focus on the reason for the bloating.

 


Resolution


Section 1: Collecting information from the PSM

Sections in Document:

  • Identifying Registry Bloating
  • Enable Logging
    • Enable PSM debug level
  • Exporting Debug Materials
  • 'LogonSessions' and 'Handles' utilities
  • Temporary solution

Identifying Registry Bloating – To be run before issue has occurred:


Using Microsoft’s Performance Monitor, we can identify how much of the Registry Quota has been utilised. Use the below steps to run a Performance Monitor capture.
 
  1. On the PSM server, open a PowerShell command prompt and run the following command:
    Logman.exe create counter Registry_Quota -f bincirc -v mmddhhmm -max 450 -c "\System\% Registry Quota In Use" -si 00:01:00
  2. Start the counter: logman start Registry_Quota
  3. Let it run for 3-5 minutes to collect data.
  4. Stop the counter: logman stop Registry_Quota
  5. A .blg file is saved under “%systemdrive%\PerfLogs\Admin”
  6. If needed, change the Performance Counter scale from 10.0 to 1.0 get an equal percentage: Right click on counter at the bottom of the Performance Monitor window --> Properties --> Change Scale to 1.0
  7. If the exported reading is showing over 50 (50%) this is likely a cause of registry bloating.
  8. Repeat this process daily keeping any previous .blg files for a comparison.

Enable Logging (To be enabled before an issue has occurred):


Enable PSM debug level:


PVWA/Pcloud Portal à Administration à Configuration Options à Options à Privileged Session Management

Set the following parameters:-

ServerSettings -> TraceLevels=1,2,3,4,5,6,7
RecorderSettings -> TraceLevels=1,2
ConnectionClient Settings -> TraceLevels=1,2
 

Exporting Debug Materials:

 
  1. Performance Montior export – Located: %systemdrive%\PerfLogs\Admin
  2. Export PSM Debug Logs via CyberArk xRay tool – After the issue has occurred
LogonSessions: (this helps identify session the OS believes are still running)
 
  1. Download this free SysInternals tool from: https://learn.microsoft.com/en-us/sysinternals/downloads/logonsessions
  2. Extract the files from the downloaded Zip file on the PSM and move the ‘LogonSessions’ folder to an easily accessible location (As there will be more tools to download you could create a ‘mstools’ folder on the root of drive C: or D:).
  3. Run an administrative command prompt then navigate to the folder (cd c:\mstools\logonsession) and type the following: logonsessions.exe -p -c > logonsessions.csv
            This will create a ‘logonsessions.csv’ file in the same folder as above.
  1. You can use an application such as Excel to view the file and identity the number of logged on sessions the server believes it has running. Please also attach the file to the case.
 

Handle: (this helps identify processes which are still running as part of the logonsessions)

 
  1. Download this free SysInternals tool from: https://learn.microsoft.com/en-us/sysinternals/downloads/handle
  2. Extract the files from the downloaded Zip file and move the ‘Handle’ folder to an easily accessible location such as C:\mstools or D:\mstools.
  3. Run an administrative command prompt then navigate to the folder (cd c:\mstools\handle) and type the following: handle.exe -a -u -vt > handle.csv
             This will create a ‘handle.csv’ file in the same folder as above.
  1. You can use an application such as Excel to view the output of the file and identity what processes are running for which user. Please also attach this file to the case alongside ‘logonsessions.csv’.

 

Temporary solution:

 
  1. Performing a Server restart allows for the registry bloating and memory to be released.
  2. Disable ‘RemoteApp’

Section 2: Preparing information for a Microsoft Support case:

Sections in Document:

  • Enable Logging
    • Microsoft Log Collection
    • Microsoft TSS Logs export
    • Windows Performance Toolkit
  • Microsoft Questions
  • Exporting Debug Materials
  • Advisory Notice

CyberArk is working directly with Microsoft regarding this issue. The third-party log collection below is based upon Microsoft's recommendations, these logs need to be collected to assist in troubleshooting the affected servers.
In each case, download the relevant Tools to an affected PSM. It is advisable to run them prior needing them to ensure there are no issues and you are familiar with the process. Some of these logs can also take some time to collect and so it can be helpful to have an idea of how much time in needed.

Enable Logging: - Install utilities but logs/information to be collected after issue has occurred, if possible.

Microsoft Log Collection:

  1. Download the latest MSRD-Collect version from https://aka.ms/MSRD-Collect
  2. Copy the file to the affected machine and extract the content into a folder such as C:\MSTools
  3. Open an elevated PowerShell window, navigate to the location where you extracted the script (e.g. C:\MSTools\MSRD-Collect) and launch it using: .\MSRD-Collect.ps1
  4. Confirm ‘Yes’ if you accept the EULA and if you agree with the data collection.
  5. The utility will check to see if it is up-to-date and will provide an option to update it if not. It is advisable to update but then you may get an error related to ‘AudioAssistMode’ and ‘SilentMode’. In this case navigate into the MSRD-Collect\Config folder and open the ‘MSRDC-Config.cfg’ file using Notepad and add the lines below to the end of the ‘’#Script settings’ section:
                        AudioAssistMode=0
                        SilentMode=0

              Save the file and restart the .\MSRD-Collect.ps1 script again of needed.
 
  1. a. Select ‘RDS’ as the Machine Context:
A screenshot of a computer  Description automatically generated
  b. Select ‘Target’ as the Machine Role:
A close-up of a computer  Description automatically generated
 
  1. Select ‘Profiles’, ‘Activation’, ‘MSRA’ and ‘Net Trace’ for the Data Collection Scenarios:
  1. When ready, click the "Start" button on the toolbar.
  2. During the procedure you will be requested to reproduce the issue. If the PSM is still functioning attempt to reproduce the ‘PSMSC036…’ error then click ‘OK’. If you are unable to reproduce the issue click ‘OK’ to continue but be sure to include this information when updating the case.
  3. Wait until the script finishes collecting all data and running the diagnostics.
  4. The script will automatically archive the collected data into a .zip file located under C:\MS_DATA. At this point you will know the script has completed as the .zip file will exist.
 

Microsoft TSS Logs export:

Collect the TSS logs from the PSM server when it shows signs of an issue – either intermittently displaying a ‘PSMSC036E….’ error or has stopped handling sessions altogether.

  1. Download the tool - https://aka.ms/getTSS
  2. Extract the contents of the zip file on the PSM server and move the extracted ‘TSS’ folder to an easily accessible location, such as a new folder on C: or D: drive called ‘mstools’ (c:\mstools)
  3. Open PowerShell as an Administrator and navigate to the location where you have located the ‘TSS’ folder (e.g. C:\MSTools\TSS)
  4. Go into folder psSDP (cd\ psSDP)
  5. Run the below command: .\get-psSDP.ps1 PERF
  6. If prompted ‘Do you want to run software from this untrusted publisher’ select ‘R’ to allow the script to run once
  7. Click on ‘Accept’ on the license agreement
  8. It will start collecting the logs from the PSM which can take several minutes to complete. You will be prompted to ‘Press Enter to continue…:’ when it has completed.
  9. It will also display ‘The item at C;\\MSDATA\SDP…..’ has children and the Recurse parameter was not specified’ select ‘Y’ or press ‘Enter’ to continue.
  10. Once the log collection is completed, it will generate a RESULTS folder at mentioned path ( c:\MS_DATA\SDP\ folder )
  11. Please provide the generated .zip file on the case.
 

Windows Performance Toolkit:

 
  1. Download and run the Windows SDK Setup
    1. Windows SDK -  https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/
    2. During setup, select "Windows Performance Toolkit". Uncheck everything else.
  2. Enable token leak tracing by setting this value in the registry: HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Kernel\SeTokenLeakDiag (DWORD) = 1
  3. From an admin command prompt, run: sc config iphlpsvc type=own
  4. Repeat the same command for each one of these: AppInfo, schedule, winmgmt, SessionEnv, wlidsvc, NcaSvc, UsoSvc, DsmSvc, WpnService, dmwappushservice, SENS, wuauserv, BITS, lfsvc, Themes, IKEEXT, UserManager, NetSetupSvc, ProfSvc, wisvc
  5. Reboot the effected machine.
  6. Reproduce the issue
  7. When you notice session ID’s are increasing (check qwinsta command), create a complete memory dump (NotMyFault).

Microsoft Questions – these will typically be asked by Microsoft support (so be prepared):

  1. Type of server, physical or virtual?
  2. Type of virtual platform, VMWare, Hyper-V, Azure
  3. Is there any monitoring set in the environment related to CPU, Disk, Memory, etc?
  4. Did you receive any alerts triggered related to impacted system?
  5. When was the last patch happened on impacted machine.

Exporting Debug Materials

  1. Screenshot of the C:\Windows\System32\Config directory
  2. Provide the export Zip file from C:\MS_DATA (Microsoft Log Collection)
  3. Upload the dump files taken with NotMyFault (Windows Performance Toolkit)
    • C:\Windows\MEMORY.DMP
    • C:\Windows\MiniDump\
  4. TSS Logs (Microsoft TSS Logs export)
  5. Microsoft Questions

Advisory notice

If the PSM server is hosted on a virtual machine, Microsoft also recommends exporting a memory dump from your selected hypervisor.
It is recommended to directly contact Microsoft for guidance on the necessary steps to export a memory dump from your chosen hypervisor solution.



Actions
  • Print
  • Copy Link

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