0

This may be more of a programming question, however, it also involves configuration, is there a way to easily, from within a script, or program determine if the current user's profile is roaming or mandatory?

More specifically is there a way to make a best programmatic guess as to weather %APPDATA% will be deleted when the user logs off?

john-charles
  • 123
  • 1
  • 3

1 Answers1

2

Contrary to popular belief mandatory profiles are not deleted when the user logs off. For details see my blog article.

If you want to check whether the user's profile is mandatory check for %userprofile%\ntuser.man. If that does not exist, the profile is not mandatory.

If you want to know whether %appdata% will be deleted at logoff you need to check the state of the group policy setting "Delete cached copies of roaming profiles". You can do that by reading the registry value HKLM\Software\Policies\Microsoft\Windows\System!DeleteRoamingCache.

Helge Klein
  • 2,101
  • 1
  • 16
  • 22