When building a new (hosted) desktop the question about what profile type to use regularly pops up. The chosen profile type has impact on logon times, performance and manageability.

The use of a UEV or UEM tool for profile virtualization is used in most environments now a days so the choice between a Local and a Mandatory profile has to be made. According to this article of Citrix the difference between a Local Profile and an Mandatory profile is not much.

I prefer to use the Local profile and make it Temporary because with this profile users get a profile that logs on fast, it can’t get corrupted and I don’t have to create and maintain the Mandatory Profile.

A Local Profile is default but to set it to Temporary requires a change in the registry. Changing a profile from Local to Temporary is often called “bitflip”.

Here is a screenshot of the Local Profile, which is default at logon. In this scenario it stays on the system when logging of:




To change the Status from Local to Temporary the following registry key needs to modified:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\*SID*\State

In this screenshot the Profile is set to the status Local (598)


The value of the State key needs to be changed to value 128.

When using a script, the SID of the user has to be found. The following PowerShell script can be used to write the SID of the current user to a variable and set the State to value 128 (Temporary):

$USERSID = ([Security.Principal.WindowsIdentity]::GetCurrent()).User.Value
[Environment]::SetEnvironmentVariable(‘USERSID’, ($USERSID), ‘User’)

Set-ItemProperty -path Registry::’HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\’$USERSID’\’ -Name State -Value 128

The script must run with administrative credentials because it writes to HKLM.

See this PaseBin site to copy and past the correct code.

In this screenshot the Profile is set to the status 128 (Temporary):



After the value of Status has changed to Temporary:



When the user logs off the profile is automatically removed from the system.
UEV/UEM tools will save and inject any personal settings from the user.

Comments are closed