Win32_TSGatewayConnectionAuthorizationPolicy 类的 Create 方法

使用指定的值 (RD CAP) 创建远程桌面连接授权策略。 新的 RD CAP 将插入到 RD CAP 评估顺序的顶部, Order 属性值为“1”。

语法

uint32 Create(
  [in] string  Name,
  [in] string  UserGroupNames,
  [in] string  ComputerGroupNames,
  [in] boolean SmartCard,
  [in] boolean Password,
  [in] boolean SecureId,
  [in] boolean Enabled,
  [in] uint32  DeviceRedirectionType,
  [in] boolean DiskDrivesDisabled,
  [in] boolean PrintersDisabled,
  [in] boolean SerialPortsDisabled,
  [in] boolean ClipboardDisabled,
  [in] boolean PlugAndPlayDevicesDisabled,
  [in] uint32  IdleTimeout,
  [in] uint32  SessionTimeout,
  [in] uint32  SessionTimeoutAction,
  [in] boolean AllowOnlySDRServers,
  [in] boolean CookieAuthentication
);

参数

Name [in]

RD CAP 的名称。 名称必须为 64 个字符或更少,唯一 () 忽略大小写,并且不能包含以下保留字符:

<> : ; " / \ | ? * [TAB]

UserGroupNames [in]

新 RD CAP 的用户组名称列表(用分号分隔)。

ComputerGroupNames [in]

新 RD CAP 的计算机组名称列表,用分号分隔。

SmartCard [in]

指定是否可以使用智能卡向 RD 网关服务器进行身份验证。

密码 [in]

指定是否可以使用密码向 RD 网关服务器进行身份验证。

SecureId [in]

此参数留待将来使用。

已启用 [in]

指定是否启用此 RD CAP。

DeviceRedirectionType [in]

指定要重定向的设备类型。

0

将重定向所有设备。

1

不会重定向任何设备。

2

不会重定向指定的设备。 DiskDrivesDisabledPrintersDisabledSerialPortsDisabledClipboardDisabledPlugAndPlayDevicesDisabled 参数控制不会重定向哪些设备。

DiskDrivesDisabled [in]

指定在 DeviceRedirectionType 参数为“2”时是否禁用磁盘驱动器重定向。

PrintersDisabled [in]

指定在 DeviceRedirectionType 参数为“2”时是否禁用打印机重定向。

SerialPortsDisabled [in]

指定如果 DeviceRedirectionType 参数为“2”,是否禁用串行端口重定向。

ClipboardDisabled [in]

指定如果 DeviceRedirectionType 参数为“2”,是否禁用剪贴板重定向。

PlugAndPlayDevicesDisabled [in]

指定在 DeviceRedirectionType 参数为“2”时是否禁用即插即用设备的重定向。

IdleTimeout [in]

空闲超时值(以分钟为单位)

SessionTimeout [in]

会话超时值(以分钟为单位)

SessionTimeoutAction [in]

会话超时操作(以分钟为单位)

AllowOnlySDRServers [in]

是否只允许连接到 SDR TS 服务器

CookieAuthentication [in]

指示是否可以使用 Cookie 身份验证连接到 TS 网关服务器

返回值

如果该方法成功,则返回零。 如果该方法不成功,则返回非零值。 有关错误代码的列表,请参阅 远程桌面服务 WMI 提供程序错误代码

备注

必须是 Administrators 组的成员才能调用此方法。

托管对象格式 (MOF) 文件包含 Windows Management Instrumentation (WMI) 类的定义。 MOF 文件未作为 Microsoft Windows 软件开发工具包 (SDK) 的一部分安装。 使用 服务器管理器添加关联角色时,它们安装在服务器上。 有关 MOF 文件的详细信息,请参阅 托管对象格式 (MOF)

要求

要求
最低受支持的客户端
无受支持的版本
最低受支持的服务器
Windows Server 2008
命名空间
Root\CIMv2\TerminalServices
MOF
TSGateway.mof
DLL
AagWmi.dll

另请参阅

Win32_TSGatewayConnectionAuthorizationPolicy