可以根據指定的條件顯示 Configuration Manager 動作。 條件定義如下:
規則運算式
方法呼叫
安全性權限
規則運算式
規則運算式可讓您套用字串型搜尋模式。 下列元素會指定動作的規則運算式:
| 元素 | 描述 |
|---|---|
MatchPattern |
指定要搜尋的模式。 |
MatchValueToTest |
指定要比較的值。 下列 ##Sub 值是所選物件的屬性。 屬性不能是延遲的,而且必須存在於 select 物件上。 |
每當指定的模式 (MS_ASYNC_RAS) 符合所選物件的 AddressType 屬性時,下列動作會顯示對話方塊:
<ActionDescription ActionVerb="Properties" Class="ShowDialog"> <ShowOn> <string>DefaultContextualTab</string> <!-- Show on Ribbon --> <string>ContextMenu</string> <!-- Show on Context Menu --> </ShowOn> <MatchPattern>MS_ASYNC_RAS</MatchPattern>
<MatchValueToTest>##SUB:AddressType##</MatchValueToTest>
<DialogId>AsyncRasSenderAddress</DialogId></ActionDescription>
方法呼叫
會根據方法呼叫的結果顯示動作。
ActionDescription子元素ActionStateAssembly會定義要呼叫的組件、類型和方法。 如果方法傳回 true,則會顯示動作;如果方法傳回 false,則會隱藏該動作。
下列 XML 會呼叫組件 AdminUI.Addresses.dll 中所命名 EnableDecrementPriorityMenu 的方法:
<ActionDescription>
<ShowOn>
<string>DefaultContextualTab</string> <!-- Show on Ribbon --> <string>ContextMenu</string><!-- Show on Context Menu --> </ShowOn> <ActionStateAssembly>
<Assembly>AdminUI.Addresses.dll</Assembly> <Type>Microsoft.ConfigurationManagement.AdminConsole.Addresses.AddressUtilityClass</Type>
<Method>EnableDecrementPriorityMenu</Method> </ActionStateAssembly>
</ActionDescription>
方法是在具有下列簽章的 .NET Framework 組件中實作:
public static bool EnableDecrementPriority(object sender, ScopeNode scopeNode, ActionDescription action, ResultObjectBase resultObject)
如需在 .NET Framework 組件中呼叫方法的詳細資訊,請參閱 Configuration Manager AssemblyType 動作。
安全性權限
您可以將安全限制套用至選取的物件或物件類別,以限制動作的可用性。
物件執行個體權限
您可以將必要權限套用至選取的物件,以限制動作的可用性。 在下列 XML 範例中,下列元素會指定所選物件的執行個體權限:
| 元素 | 描述 |
|---|---|
InstancePermissions |
執行個體權限清單的父元素。 |
SecurityFlagsDetailDescription |
必須設定才能讓動作運作的安全性旗標。 |
在下列 XML 範例中, Delete 只有當使用者具有修改權限時,才能使用所選物件的動作:
<ActionDescription ActionVerb="Delete" Class="Default" SelectionMode="Both" InstanceDependsOn="SMS_Site">
<ShowOn> <string>DefaultContextualTab</string> <!-- Show on Ribbon --> <string>ContextMenu</string> <!-- Show on Context Menu --></ShowOn><InstancePermissions><SecurityFlagsDetailDescription BitName="Modify" BitValue="2" DependsOn="1" /></InstancePermissions>
</ActionDescription>
物件類別權限
您可以使用元素 ClassPermissions 來設定動作所需的物件類別權限。
ActionSecurityDescription 描述物件類別及該物件類別的必要許可權。 下列 XML 範例說明簡訊集合所需的權限:
<ClassPermissions> <ActionSecurityDescription ClassObject="SMS_Collection" RequiredPermissions="1280" />
</ClassPermissions>
權限值
RequiredPermissions 屬性的權限值與 SecurityFlagsDetailDescription 類別的權限值相同,如下所示:
| 權限 | 值 | 取決於 |
|---|---|---|
| 讀取 | 1 | 無 |
| 修改 | 2 | 1 |
| 刪除 | 4 | 1 |
| Distribute | 8 | 1 |
| CreateChild | 16 | 1 |
| RemoteControl | 32 | 無 |
| Advertise | 64 | 1 |
| ModifyResource | 128 | 1 |
| 管理 | 256 | 7 |
| DeleteResource | 512 | 1 |
| 建立 | 1024 | 無 |
| ViewCollectedFiles | 2048 | 1 |
| ReadResource | 4096 | 1 |
| 代理人 | 8192 | 無 |
| 儀表 | 16384 | 1 |
| ManageSqlCommand | 32768 | 1 |
| ManageStatusFilter | 65536 | 1 |
| ManageFolder | 131072 | 1 |
| NetworkAccess | 262144 | 1 |
| ImportMachineEntry | 524288 | 1 |
| CreateMediaCertificate | 1048576 | 1 |
| ModifyCollectionSetting | 2097152 | 1 |
| ManageOsdCertificate | 4194304 | 1 |
另請參閱
Configuration Manager ActionsConfigurationManager 動作 XMLConfigurationManager AssemblyType Action:Configuration Manager 可執行檔 ActionConfigurationManager群組動作:Configuration Manager 報表 action:Configuration Manager ShowDialog 動作如何建立 Configuration Manager 動作如何尋找 Configuration Manager 節點 GUID