How to delete local and roaming profiles

Posted: July 12, 2011 in Systems Administration

While in the Higher Education Industry I stumbled upon the need to delete roaming and local profiles from a Terminal Services Server. First time I deleted them manually (thinking it was a one time thing), but then I had to do it three to four times a day, I knew i needed to automate this and fast. I found a cool application from Microsoft named Delprof.exe. Its a command-line utility that you can use to delete user profiles on a local or remote computers. Here are a few steps for the utility:

1. Download the utility from the microsoft site

2. Install Delprof.msi

3. Search for it in the installed path and move it to a shared folder on your server (why a server?  Either on an Enterprise or Small Business Environment your server is the place to store these files for continued use)

4. Create batch file name ProfileDeletion.bat with the following instructions: \\MyServer\Scripts\delprof.exe /q /i  and then save it (remember to substitute Myserver\Scripts for the path where you stored the delprof.exe file)

5.  Create a group Policy Object on your domain controller add the script and activate it when needed.

Here are the common command for this utility:

/Q -quiet no confirmations

/I -ignore errors and continue deleting

/P -Prompts for comfirmation before deleting each profile

/R -Delete roaming profile cache only

/C -Remote Computer name

/D -Number of days of inactivity

Depending on the switch will be the information you will need to add to the script or batch file. I hope this information was useful and remember to ask any questions you might have on this.

  1. yaron says:

    about roaming profile cleaning, you can try this free software . I tried it on my network and its works fine on all windows versions (also 2012R2)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s