Share via


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
);

參數

名稱 [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

將不會重新導向指定的裝置。 DiskDrivesDisabled、PrintersDisabledSerialPortsDisabled、ClipboardDisabledPlugAndPlayDevicesDisabled參數可控制不會重新導向哪些裝置。

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 群組的成員,才能呼叫此方法。

Managed 物件格式 (MOF) 檔案包含 Windows Management Instrumentation (WMI) 類別的定義。 MOF 檔案不會安裝為 Microsoft Windows 軟體發展工具組 (SDK) 的一部分。 當您使用 伺服器管理員 新增相關聯的角色時,它們會安裝在伺服器上。 如需 MOF 檔案的詳細資訊,請參閱 Managed 物件格式 (MOF)

規格需求

需求
最低支援的用戶端
都不支援
最低支援的伺服器
Windows Server 2008
命名空間
Root\CIMv2\TerminalServices
MOF
TSGateway.mof
DLL
AagWmi.dll

另請參閱

Win32_TSGatewayConnectionAuthorizationPolicy