From your description, I understand that you want cleanup the Terminal Server users profiles, you can according to the following methods:
Using Group Policies
1.Open Group Policy.
2.In Computer Configuration\ Policies\ Administrative Templates\ Windows Components\ Terminal Services\ Terminal Server\ Temporary folders, double-click the Do not delete temp folder upon exit setting.
3.To retain users’ temporary folders when a user logs off from a session, click Enabled. To delete users’ temporary folders when a user logs off, click Disabled.
Using Terminal Services Configuration
1.Open Terminal Services Configuration.
2.In the console tree, click Server Settings.
3.In the details pane, right-click Delete temporary folders on exit, and then click Properties.
4.Click Yes to have temporary folders deleted when a user logs off from a session, or click No to retain temporary folders, and then click OK.
TS Temporary Folders: