Get-CMCollectionQueryMembershipRule
取得裝置或使用者集合的查詢成員資格規則。
Syntax
Get-CMCollectionQueryMembershipRule
-CollectionName <String>
[-RuleName <String>]
[<CommonParameters>]
Get-CMCollectionQueryMembershipRule
-CollectionId <String>
[-RuleName <String>]
[<CommonParameters>]
Get-CMCollectionQueryMembershipRule
-InputObject <IResultObject>
[-RuleName <String>]
[<CommonParameters>]
Description
使用此 Cmdlet 來取得裝置或使用者集合的一或多個查詢成員資格規則。 查詢規則可讓您根據依排程執行的查詢,動態更新集合的成員資格。 如需詳細資訊,請參閱如何在 Configuration Manager 中建立集合。
如需成員資格規則的詳細資訊,請參閱Configuration Manager 中的集合簡介。
注意事項
從Configuration Manager月臺磁片磁碟機執行 Configuration Manager Cmdlet,例如 PS XYZ:\>
。 如需詳細資訊,請 參閱開始使用。
範例
範例 1:取得所有系統集合的所有查詢成員資格規則
此命令會從名為 [所有系統] 的預設裝置集合中取得查詢成員資格規則。
Get-CMCollectionQueryMembershipRule -CollectionName "All Systems"
範例 2:檢視所有使用者集合上規則的查詢運算式
此命令會從 [所有使用者 ] 集合取得名為 [ 所有使用者 ] 的查詢成員資格規則,並傳回查詢運算式。
Get-CMCollectionQueryMembershipRule -CollectionId "SMS00002" -RuleName "All Users" | Select-Object QueryExpression
參數
-CollectionId
指定要取得規則之集合的識別碼。 這個值是 CollectionID 屬性,例如 或 XYZ00012
SMS00001
。
Type: | String |
Aliases: | Id |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CollectionName
指定要取得規則的集合名稱。
Type: | String |
Aliases: | Name |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
指定集合的 物件以取得規則。 若要取得此物件,請使用 Get-CMCollection、 Get-CMDeviceCollection或 Get-CMUserCollection Cmdlet。
Type: | IResultObject |
Aliases: | Collection |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-RuleName
指定要從集合取得的查詢規則名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸入
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
輸出
System.Object
備註
此 Cmdlet 類似于 Get-CMDeviceCollectionQueryMembershipRule 和 Get-CMUserCollectionQueryMembershipRule,這些是集合類型特有的。 此 Cmdlet 適用于裝置或使用者集合。
相關連結
- Remove-CMCollectionQueryMembershipRule
- Get-CMCollectionDirectMembershipRule
- Get-CMCollectionExcludeMembershipRule
- Get-CMCollectionIncludeMembershipRule
- Add-CMDeviceCollectionQueryMembershipRule
- Add-CMUserCollectionQueryMembershipRule
- Get-CMDeviceCollectionQueryMembershipRule
- Get-CMUserCollectionQueryMembershipRule
- Get-CMCollection
- Get-CMDeviceCollection
- Get-CMUserCollection
- 如何在 Configuration Manager 中建立集合
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應