Delprof – Terminal Server User Profile Deletion Utility

Overview

In this tutorial we will use a command called Delprof that will help you delete disconnected User Profiles from Windows Terminal Server.

terminal-services-logo Delprof

If your terminal server is a public one you might want to delete the User profiles in order to save disk space.
But if you just delete the profile folders you might have an issue when the user logs back in and the server tries to recreate the profile.
In order to avoid this issue Microsoft has released a small app called Delprof allowing you to delete the profiles automatically or interactively.

First you need to download and install Windows Server 2003 Resource Kit Tools

DELPROF usage:
DELPROF [/Q] [/I] [/P] [/R] [/C:\\<computername>] [/D:<days>]</days></computername>

/Q      Quiet, no confirmation.
/I      Ignore errors and continue deleting.
/P      Prompts for confirmation before deleting each profile.
/R      Delete roaming profile cache only
/C      Remote computer name.
/D      Number of days of inactivity.

Now you can create a script that runs with a Scheduled Task or at Statup/Shutdown:

C:\Program Files (x86)\Windows Resource Kits\Tools\delprof.exe /i /q

Enjoy

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.