Get-CMCollectionExcludeMembershipRule

取得裝置或使用者集合的排除成員資格規則。

語法

Get-CMCollectionExcludeMembershipRule
   -CollectionName <String>
   [-ExcludeCollectionName <String>]
   [<CommonParameters>]
Get-CMCollectionExcludeMembershipRule
   -CollectionName <String>
   -ExcludeCollection <IResultObject>
   [<CommonParameters>]
Get-CMCollectionExcludeMembershipRule
   -CollectionName <String>
   -ExcludeCollectionId <String>
   [<CommonParameters>]
Get-CMCollectionExcludeMembershipRule
   -CollectionId <String>
   -ExcludeCollection <IResultObject>
   [<CommonParameters>]
Get-CMCollectionExcludeMembershipRule
   -CollectionId <String>
   -ExcludeCollectionId <String>
   [<CommonParameters>]
Get-CMCollectionExcludeMembershipRule
   -CollectionId <String>
   [-ExcludeCollectionName <String>]
   [<CommonParameters>]
Get-CMCollectionExcludeMembershipRule
   -InputObject <IResultObject>
   -ExcludeCollection <IResultObject>
   [<CommonParameters>]
Get-CMCollectionExcludeMembershipRule
   -InputObject <IResultObject>
   -ExcludeCollectionId <String>
   [<CommonParameters>]
Get-CMCollectionExcludeMembershipRule
   -InputObject <IResultObject>
   [-ExcludeCollectionName <String>]
   [<CommonParameters>]

Description

使用此 Cmdlet 來取得裝置或使用者集合的一或多個排除成員資格規則。 排除成員資格規則會從套用規則的集合中排除另一個集合的成員。

如果排除集合的成員資格變更,Configuration Manager 會依排程動態更新集合的成員資格。

如需詳細資訊,請 參閱如何在 Configuration Manager 中建立集合

注意事項

從 Configuration Manager 月臺磁碟驅動器執行 Configuration Manager Cmdlet,例如 PS XYZ:\>。 如需詳細資訊,請 參閱開始使用

範例

範例 1:取得集合的排除成員資格規則

此命令會取得規則,這些規則會將標識 碼SMSDM001 的集合成員從標識 碼XYZ00012的集合中排除。

Get-CMCollectionExcludeMembershipRule -CollectionId "XYZ00012" -ExcludeCollectionId "SMSDM001"

參數

-CollectionId

指定要取得規則之集合的識別碼。 這個值是 CollectionID 屬性, 例如 。 XYZ00012 因為預設集合沒有排除成員資格規則,所以此標識符會以月臺碼開頭,而不是 SMS

類型:String
別名:Id
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-CollectionName

指定要取得規則的集合名稱。

類型:String
別名:Name
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ExcludeCollection

指定排除集合的物件以取得規則。 若要取得此物件,請使用 Get-CMCollectionGet-CMDeviceCollectionGet-CMUserCollection Cmdlet。

類型:IResultObject
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ExcludeCollectionId

指定排除集合的識別碼以取得規則。 這個值是 CollectionID 屬性, 例如 。 XYZ00012 您可以排除預設集合,因此此值可以從月臺碼或 SMS開頭。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ExcludeCollectionName

指定排除集合的名稱以取得規則。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InputObject

指定集合的物件以取得規則。 若要取得此物件,請使用 Get-CMCollectionGet-CMDeviceCollectionGet-CMUserCollection Cmdlet。

類型:IResultObject
別名:Collection
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

輸入

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

輸出

System.Object

備註

此 Cmdlet 類似於 Get-CMDeviceCollectionExcludeMembershipRuleGet-CMUserCollectionExcludeMembershipRule,這是集合類型專屬的。 此 Cmdlet 適用於裝置或使用者集合。