Get-CMCollectionQueryMembershipRule
デバイスまたはユーザー コレクションのクエリ メンバーシップ ルールを取得します。
構文
Get-CMCollectionQueryMembershipRule
-CollectionName <String>
[-RuleName <String>]
[<CommonParameters>]
Get-CMCollectionQueryMembershipRule
-CollectionId <String>
[-RuleName <String>]
[<CommonParameters>]
Get-CMCollectionQueryMembershipRule
-InputObject <IResultObject>
[-RuleName <String>]
[<CommonParameters>]
説明
このコマンドレットを使用して、デバイスまたはユーザー コレクションの 1 つ以上のクエリ メンバーシップ ルールを取得します。 クエリ ルール を使用すると、スケジュールに従って実行されるクエリに基づいてコレクションのメンバーシップを動的に更新できます。 詳細については 、「Configuration Manager でコレクションを作成する方法」を参照してください。
メンバーシップ ルールの詳細については 、「Configuration Manager のコレクションの概要」を参照してください。
注意
Configuration Manager サイト ドライブから Configuration Manager コマンドレットを実行します PS XYZ:\> 。 詳細については 、「Getting started」を参照してください。
例
例 1: All Systems コレクションのすべてのクエリ メンバーシップ ルールを取得する
このコマンドは、All Systems という名前の既定のデバイス コレクションからクエリ メンバーシップ ルール を取得します。
Get-CMCollectionQueryMembershipRule -CollectionName "All Systems"
例 2: All Users コレクションのルールのクエリ式を表示する
このコマンドは、All Users コレクションから All **** Usersという名前のクエリ メンバーシップ ルールを取得し、クエリ式を返します。
Get-CMCollectionQueryMembershipRule -CollectionId "SMS00002" -RuleName "All Users" | Select-Object QueryExpression
パラメーター
ルールを取得するコレクションの ID を指定します。 この値は 、CollectionID プロパティです 。たとえば XYZ00012 、または SMS00001 .
| Type: | String |
| Aliases: | Id |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
ルールを取得するコレクションの名前を指定します。
| Type: | String |
| Aliases: | Name |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
ルールを取得するコレクションのオブジェクトを指定します。 このオブジェクトを取得するには 、Get-CMCollectionコマンドレット 、Get-CMDeviceCollectionコマンドレット、 または Get-CMUserCollection コマンドレットを使用します。
| Type: | IResultObject |
| Aliases: | Collection |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
コレクションから取得するクエリ ルールの名前を指定します。
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
入力
Microsoft.ConfigurationManagement.ManagementProvider.IResultObject
出力
System.Object
メモ
このコマンドレットは、コレクションの種類に固有の Get-CMDeviceCollectionQueryMembershipRule および Get-CMUserCollectionQueryMembershipRuleに似ています。 このコマンドレットは、デバイス またはユーザー コレクションで動作します。
関連リンク
- Remove-CMCollectionQueryMembershipRule
- Get-CMCollectionDirectMembershipRule
- Get-CMCollectionExcludeMembershipRule
- Get-CMCollectionIncludeMembershipRule
- Add-CMDeviceCollectionQueryMembershipRule
- Add-CMUserCollectionQueryMembershipRule
- Get-CMDeviceCollectionQueryMembershipRule
- Get-CMUserCollectionQueryMembershipRule
- Get-CMCollection
- Get-CMDeviceCollection
- Get-CMUserCollection
- Configuration Manager でコレクションを作成する方法