Citrix Profile management is intended as a profile solution for XenApp servers, virtual desktops created with XenDesktop, and physical desktops to ensures that the user’s personal settings are applied to the user’s virtual desktop and applications, regardless of the location and end point device.
Profile management is enabled through a profile optimization service that provides an easy, reliable way for managing these settings in Windows environments to ensure a consistent experience by maintaining a single profile that follows the user. It auto-consolidates and optimizes user profiles to minimize management and storage requirements and requires minimal administration, support and infrastructure, while providing users with improved logon and logout.

Muralidhar Maram, a Citrix employee, did write a handy small CLI tool to clean up junk in the profile store.
Attention: This tool doesn’t work with Studio based policies, only AD GPOs

The tools Supported Arguments:

Just double click or No Arguments passed – Lists all files that to be deleted in Profile Store.
CleanPMStore.exe List – Same as No inputs, Just lists all files that to be deleted in Profile Store.
CleanPMStore.exe Delete – Delete all the excluded files for all the users in store. Also takes a backup before deletion.
CleanPMStore.exe DeleteBackups – Deletes the Backup files created by the tool for all the users in store.
CleanPMStore.exe List <UserName> –Lists all files that to be deleted in Profile Store for a specific user.
CleanPMStore.exe Delete <UserName> – Delete all the excluded files in Store for a specific user. Also takes a backup before deletion.
CleanPMStore.exe DeleteBackups <UserName> – Deletes the Backup files created by the tool for a specific user.

How to Run: Launch an XA or XD Session which have new exclusion and inclusion policies and run the tool with Admin privileges in order to clean all users profiles.

The tool Logs can be found at “C:\UPMCleanup” and Backup of deleted files will be located at “ProfilesStore\UPM_Profile_CleanedFiles”.
Exampel: Back up of \\FileServer\profiles\Peter\UPM_Profile excluded files will be saved at: \\FileServer\profiles\Peter\UPM_Profile_CleanedFiles

 

Useful Tips Powershell:

Clean-up your profile share by deleting all renamed profiles, as “profilename.old”
remove-item *.old* -Force -Recurse -ErrorAction SilentlyContinue | Where { $_.PSIsContainer }

Print out all profile names to a text file “All_Profile_Folders.txt”:
Get-ChildItem -Recurse | ?{ $_.PSIsContainer } | Select-Object FullName > C:\Users\admpetsma01\Desktop\All_Profile_Folders.txt