by: Helge, published: Jan 24, 2010, updated: Mar 13, 2021, in

Are Mandatory User Profiles Deleted at Logoff – or Cached?

This article is part of Helge’s Profile Toolkit, a set of posts explaining the knowledge and tools required to tame Windows user profiles.

A popular misconception about mandatory user profiles is that they are deleted at logoff. I freely admit that I thought so, too, until I made some tests that proved I was wrong.

Locally Cached Mandatory Profiles

First, if you want to read up on the subject, see my earlier article Mandatory Profiles – The Good, the Bad and the Ugly.

Now let us dig into the subject of this post.

Mandatory profiles are similar to roaming profiles in that a master copy lives on a file server that gets copied down to the local machine at logon. Thus a locally cached version of the mandatory profile is created that is used and changed during the user session. This local copy of the mandatory profile is created once for each user, just as with a roaming profile. And at logoff, it stays where it is, unchanged. Windows does not delete mandatory profiles at logoff. (There was a bug in Windows XP that caused mandatory profiles to be deleted. It has been fixed in service pack 3.)

But wait, are mandatory profiles not reset at each logon? Yes they are. But that does not happen through deletion of the locally cached version during logoff, but by replacing the local copy with the network copy during logon. In other words, everything the user changed during his or her last session is lost – that is what mandatory profiles are all about.

So what is that local cache used for, if it is reset at logon? It has one use only: allow logons when the network is not available. Only in that case the state of an earlier session is available in a later session.

How to Delete Mandatory Profiles

You probably do not want cached profiles to litter your systems. The group policy setting “Delete cached copies of roaming profiles” affects not only roaming, but also mandatory profiles. The setting is located here: Computer Configuration -> System -> User Profiles. If enabled, Windows deletes cached copies of roaming and mandatory profiles at logoff.

Unfortunately this group policy setting does not seem to have any effect on Server 2008 SP1. I simply could not get that version to delete cached mandatory profiles at logoff although cached roaming profiles were deleted as expected. There might be a bug in Windows Server 2008 SP1 breaking the deletion of cached mandatory profiles. After updating the machine to SP2 the problem was gone. On all other versions of Windows I tested (see below) mandatory profiles were deleted correctly if “Delete cached copies of roaming profiles” was enabled.

Applies to

The information in this article applies to Windows in general. However, I have tested on these versions:

  • XP (x86) SP3
  • Server 2003 x64 SP2
  • Server 2008 x64 SP1
  • Server 2008 x64 SP2
  • Windows 7 RTM
  • Server 2008 R2 RTM
Previous Article Visual Studio: Fixing Broken $(WindowsSdkDir) Variable
Next Article New Articles, Tools, Tips and Tricks: Windows (7 and 2008 R2), PowerShell and Citrix