Share via


Win32_FolderRedirectionUserConfiguration class

Represents the user's folder redirection configuration settings.

The following syntax is simplified from Managed Object Format (MOF) code and includes all of the inherited properties.

Syntax

class Win32_FolderRedirectionUserConfiguration
{
  boolean                 IsEffective;
  boolean                 PrimaryComputerEnabled;
  Win32_FolderRedirection AppDataRoaming;
  Win32_FolderRedirection Desktop;
  Win32_FolderRedirection StartMenu;
  Win32_FolderRedirection Documents;
  Win32_FolderRedirection Pictures;
  Win32_FolderRedirection Music;
  Win32_FolderRedirection Videos;
  Win32_FolderRedirection Favorites;
  Win32_FolderRedirection Contacts;
  Win32_FolderRedirection Downloads;
  Win32_FolderRedirection Links;
  Win32_FolderRedirection Searches;
  Win32_FolderRedirection SavedGames;
};

Members

The Win32_FolderRedirectionUserConfiguration class has these types of members:

Properties

The Win32_FolderRedirectionUserConfiguration class has these properties.

AppDataRoaming

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's AppData\\Roaming folder.

Contacts

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Contacts folder.

Desktop

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Desktop folder.

Documents

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Documents folder.

Downloads

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Downloads folder.

Favorites

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Favorites folder.

IsEffective

Data type: boolean

Access type: Read-only

If true, the configuration settings are in effect.

Links

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Links folder.

Music

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Music folder.

Pictures

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Pictures folder.

PrimaryComputerEnabled

Data type: boolean

Access type: Read/write

If true, the Primary Computer feature is enabled for this user.

SavedGames

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Saved Games folder.

Searches

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Searches folder.

StartMenu

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Start Menu folder.

Videos

Data type: Win32_FolderRedirection

Access type: Read/write

A Win32_FolderRedirection object that represents the properties of the user's Videos folder.

Remarks

Folder redirection must be applied during logon, and the logon process cannot be completed until folder redirection is complete. This ensures that:

  • The files are not being used by any application and can be freely redirected by the feature.
  • The user's folders and files will be fully configured before the user accesses them.

In Windows 7, Windows Server 2008 R2, and earlier Windows versions, folder redirection was implemented by a Group Policy Client Side Extension (GPCSE) that received the following data from the Group Policy Manager:

  • The list of folders to be redirected
  • The user's logon state
  • The user's impersonation token

In Windows 8, Windows Server 2012, and later, folder redirection can be performed by WMI or by Group Policy. If it's performed by WMI, the Win32_FolderRedirectionUserConfiguration class itself contains the list of folders to be redirected.

Because folder redirection must be applied during logon, and the logon process cannot be completed until folder redirection is complete, the user's logon must be blocked until Folder Redirection is applied. To ensure this behavior, you must implement a GPCSE. This GPCSE is invoked by the Group Policy Manager on every logon. The Group Policy Manager informs the GPCSE extension if the logon is blocked or not and passes a user token to the GPCSE that can be used for impersonation.

To pass the user's logon state and impersonation token, this class requires a context object to be passed as the pCtx parameter to the IWbemServices::GetObject method. This context object has the following properties, which should be set to the following values:

Property Name Type Specify This Value
PolicyPlatformContext_PrincipalContext_Type VT_BSTR "PolicyPlatform_UserContext"
PolicyPlatformContext_PrincipalContext_Id VT_BSTR The user's SID in SDDL format
PolicyPlatformContext_PrincipalContext_UserSession VT_I4 The identifier of a Windows session to which the user is interactively logged on. It is possible that there are multiple sessions to which the user is logged on interactively. The MPP will pass the id of one of these sessions.
PolicyPlatformContext_PrincipalContext_Flags VT_I4 This property is set to zero to indicate that the user's logon is blocked. Folder Redirection can be safely applied, because the user's files are guaranteed not to be in use.
This property is set to 0x10 to indicate a nonblocking state, in which Folder Redirection should not be applied.
PolicyPlatformContext_PrincipalContext_ProcessId VT_I4 The process identifier of the process that owns the user's impersonation token
PolicyPlatformContext_PrincipalContext_UserToken VT_I8 The user's impersonation token

Requirements

Minimum supported client
Windows 8 [desktop apps only]
Minimum supported server
Windows Server 2012 [desktop apps only]
Namespace
Root\CIMv2
MOF
FolderRedirectionWMIProvider.mof

See also

Win32_FolderRedirection

Win32_FolderRedirectionHealth

Win32_FolderRedirectionHealthConfiguration