How to selectively delete roaming profiles on remote machines
By Koder at Tue, 03/09/2010 - 15:56
Reasons for giving a user a new profile:
If you are a Windows Systems Administrator working in a Windows Active Directory environment and use roaming profiles, this article is for you. In this article we will show you how to delete roaming profiles on remote machines selectively (meaning only roaming profiles you choose and not the others). Microsoft has a free resource kit utility called delprof, which allows to delete cached roaming profiles on remote machines, it even lets you choose the deletion criteria based on the period since the roaming profile has not been used on that machine. However, delprof has a serious limitation, it does not let you choose an individual roaming profile or a list of roaming profile to be deleted. We will show you how to overcome this limitation.
Reasons for giving a user a new profile:
Sometimes roaming user profiles get corrupt, it could be a problem with their default Word template, settings in Internet Explorer not working and various other things. In such a case, rather than completely troubleshoot the profile, you might want to restart by giving the user a clean, default user profile that you know works. You can always make a backup of the existing profile and copy things such as Desktop Icons, Favorites, Printers and Quick Launch shortcuts etc to the new profile.
Cached roaming profiles need to be deleted when a user gets a new profile:
If you were ever giving a user new user profile for whatever reason, you need to make sure you delete the cached roaming profiles from all the machines user has logged on to, making sure there is no corruption again in the profile if the user logs on to an old machine with the cached profile.
Limitation of the DelProf utility:
Delprof will let you delete roaming profiles on a remote machine, but it will also keep prompting you to delete other legit roaming profiles on those machines you have to from the remote machine, it attempts to delete all roaming profiles, there is no way of choosing only one specific one.
RemProf superceeds DelProf:
The solution is a freeware utility called RemProf from Ctrl-Alt-Del Consultancy. You can download the freeware application from http://www.ctrl-alt-del.com.au/CAD_TSUtils.htm#Freeware , information about licensing and it being freeware is at http://www.ctrl-alt-del.com.au/files/CAD_UtilPack.txt . RemProf has been tested on Windows 2000, 2003, XP. List of command switches is available by doing a remprof.exe /?
Using the RemProf Utilities, Real World Examples:
1.Following command will delete any profile older than 10 days, excluding bob and marry
REMPROF /D:10 /EXCLUDE:bob,mary
2.Following command will delete any profile with broken SIDs (username has been deleted in Active Directory)
3.Following command will delete only the user profile called Koder
REMPROF /L Koder
Running RemProf to delete profiles on Remote Machines:
You can run RemProf utility on remote computers to delete roaming profiles on remote machines by combining it with the Psexec.exe free utility. The free PSExec utility can be downloaded from http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
Once you have downloaded the utility, you can create a file called remotecomputers.txt with one remote computername on each line. When you run the following command, it will delete the profile of a user called Koder on the list of machines contained in the remotecomps.txt file. Also make sure, that the psexec.exe, remprof.exe and remotecomputerss.txt are located in YOUR C:\temp directory
C:\temp\psexec.exe @C:\temp\remotecomputers.txt -c C:\temp\remprof.exe koder
The only one thing you need to keep in mind is that you need to have a local administrator access on machines where you are trying to delete the profiles on. You can also use RemProf as a scheduled task on the machines where it runs every so many days to delete the cached profiles which have not been used in so long!
We hope this has been a helpful article for you. If you deal with roaming profiles and delete remote profiles any other way, do let us know by leaving us a comment here.