共用方式為


CiTool 技術參考

CiTool 可讓 IT 系統管理員更輕鬆地 Windows Defender 應用程控 (WDAC) 原則管理。 您可以使用此工具來管理 Windows Defender 應用程控原則和 CI 令牌。 本文說明如何使用 CiTool 來更新和管理原則。 它目前包含在 Windows 11 版本 22H2 的 Windows 映射中。

原則命令

命令 描述 Alias
--update-policy </Path/To/Policy/File> 新增或更新目前系統上的原則。 -up
--remove-policy <PolicyGUID> 從系統中移除 PolicyGUID 所指示的原則。 -rp
--list-policies 系統上所有原則的傾印資訊,不論原則是否為作用中。 -lp

令牌命令

命令 描述 Alias
--add-token <Path/To/Token/File> <--token-id ID> 使用選用的特定識別碼,將令牌部署至目前的系統。 -at
--remove-token <ID> 從系統中移除以標識元表示的令牌。 -rt
--list-tokens 系統上所有令牌的傾印資訊。 -lt

注意

關於 --add-token,如果 <ID> 已指定 ,則應該不存在具有 的既存令牌 <ID>

其他命令

命令 描述 Alias
--device-id 傾印程式代碼完整性裝置標識碼。 -id
--refresh 嘗試重新整理 WDAC 原則。 -r
--help 顯示工具的說明功能表。 -h

輸出屬性和描述

列出 (--list-policies) 的原則

    Policy ID: d2bda982-ccf6-4344-ac5b-0b44427b6816
    Base Policy ID: d2bda982-ccf6-4344-ac5b-0b44427b6816
    Friendly Name: Microsoft Windows Driver Policy
    Version: 2814751463178240
    Platform Policy: true
    Policy is Signed: true
    Has File on Disk: false
    Is Currently Enforced: true
    Is Authorized: true
    Status: 0
屬性 描述 範例值
原則標識碼 清單 原則的標識碼。 d2bda982-ccf6-4344-ac5b-0b44427b6816
基底原則標識碼 清單 基底原則的標識碼。 d2bda982-ccf6-4344-ac5b-0b44427b6816
易記名稱 中列出的值 <Setting Provider="PolicyInfo" Key="Information" ValueName="Name"> Microsoft Windows Driver Policy
版本 中所列原則的版本 <VersionEx> 2814751463178240
平台原則 指出原則是否由 Microsoft 提供,例如在易受攻擊的驅動程式封鎖清單原則中。 true
原則已簽署 指出原則是否具有有效的簽章。 true
磁碟上有檔案 指出原則檔案目前是否在磁碟上。 false
目前強制執行 指出原則檔案是否作用中。 true
已獲授權 如果原則需要啟用令牌,這個值就是令牌的授權狀態。 如果原則不需要令牌,此值會符合 Is Currently Enforced 屬性的值。 true

範例

部署 WDAC 原則

CiTool --update-policy "\Windows\Temp\{BF61FE40-8929-4FDF-9EC2-F7A767717F0B}.cip"

重新整理系統上的 WDAC 原則

CiTool --refresh

依原則標識碼移除特定 WDAC 原則

CiTool --remove-policy "{BF61FE40-8929-4FDF-9EC2-F7A767717F0B}"

列出系統上主動強制執行的 WDAC 原則

# Check each policy's IsEnforced state and return only the enforced policies
(CiTool -lp -json | ConvertFrom-Json).Policies | Where-Object {$_.IsEnforced -eq "True"} |
Select-Object -Property PolicyID,FriendlyName | Format-List

顯示說明功能表

CiTool -h

----------------------------- Policy Commands ---------------------------------
  --update-policy /Path/To/Policy/File
    Add or update a policy on the current system
    aliases: -up
  --remove-policy PolicyGUID
    Remove a policy indicated by PolicyGUID from the system
    aliases: -rp
  --list-policies
    Dump information about all policies on the system, whether they be active or not
    aliases: -lp
----------------------------- Token Commands ---------------------------------
  --add-token Path/To/Token/File <--token-id ID>
    Deploy a token onto the current system, with an optional specific ID
    If <ID> is specified, a pre-existing token with <ID> should not exist.
    aliases:-at
  --remove-token ID
    Remove a Token indicated by ID from the system.
    aliases: -rt
  --list-tokens
    Dump information about all tokens on the system
    aliases: -lt
----------------------------- Misc Commands ---------------------------------
  --device-id
    Dump the Code Integrity Device Id
    aliases: -id
  --refresh
    Attempt to Refresh CI Policies
    aliases: -r
  --help
    Display this message
    aliases: -h