The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

RsopCreateSession method of the RsopLoggingModeProvider class

Takes a snapshot of actual policy data for display by the RSoP MMC snap-in (rsop.msc).

This method is implemented in the provider.


static void RsopCreateSession(
  [in]  uint32 flags,
  [in]  string userSid,
  [out] string nameSpace,
  [out] uint32 hResult,
  [out] uint32 ExtendedInfo


flags [in]

Specifies a set of bit flags. You can use this parameter to specify the type of data to retrieve. If you do not specify a type, the method retrieves both user and computer data. You can also specify whether the system should create a new snapshot of the WMI namespace to contain the RSoP data.


Retrieve RSoP computer data only.


Retrieve RSoP user data only.


Create a temporary snapshot of the WMI namespace. For more information, see the following Remarks section.

userSid [in]

Specifies the SID of the user of interest. If this parameter is NULL, the function uses the SID of the calling thread. For more information, see Security Identifiers.

nameSpace [out]

Specifies the RSoP namespace where logging mode data is created. Computer data is stored under "nameSpace\Computer" and user data is stored under "nameSpace\User\{Sid}". An example of a namespace would be "\\.\Root\Rsop\NS71EF4AA3_FB96_465F_AC1C_DFCF9A3E9010".

You can run the RSoP MMC snap-in to display the data in the RSoP namespace, specifying the generated namespace and the computer on which the logging mode provider was invoked. For more information, see the following Remarks section.

hResult [out]

An HRESULT that indicates the success or failure of the method. If the method succeeds, the return value is S_OK. Otherwise, the method returns one of the COM error codes defined in the Platform SDK header file WinError.h.

ExtendedInfo [out]

Currently, this parameter can have one of the following values.


User RSoP data is not available to the user.


Computer RSoP data is not available to the user.


The value FLAG_FORCE_CREATENAMESPACE was not specified in the flags parameter and a snapshot of the namespace already exists; the user is not an administrator. For more information, see the following Remarks section.

Return value

This method has no return value. For more information, see the description of the hResult parameter.


Non-administrative users and users without RSoP delegation are allowed one temporary RSoP namespace for logging mode data. If you pass the FLAG_FORCE_CREATENAMESPACE flag to the RsopCreateSession method, the logging mode provider deletes the user's existing RSoP namespace and creates a new namespace for the user with updated logging mode data.

To view RSoP logging mode data, an administrator could pass the namespace returned by this method as a command-line parameter to the RSoP MMC snap-in. For example, if you run the snap-in on the computer "", you could invoke the snap-in in the following manner:

Rsop.msc /RsopNamespace:"\\.\Root\Rsop\NS71EF4AA3_FB96_465F_AC1C_DFCF9A3E9010" /RsopTargetComp:""

To remotely target the RSoP snap-in to the same namespace, you could invoke the snap-in in the following manner:

Rsop.msc /RsopNamespace:"\\\Root\Rsop\NS71EF4AA3_FB96_465F_AC1C_DFCF9A3E9010" /RsopTargetComp:""

For more information about running rsop.msc from the command-line, see the Windows Server Help.


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008







See also

Group Policy Overview
Group Policy RSoP WMI Classes