在 Microsoft Intune 中建立篩選時,應用程式和裝置屬性、操作員和規則編輯

當您建立應用程式、合規性原則或組態配置檔時,您會將該應用程式或原則指派給) 使用者或裝置 (群組。 當您指派應用程式或原則時,也可以使用 指派篩選

您可以在受控裝置上使用篩選, (Intune) 和受控應用程式中註冊的裝置, (Intune) 所管理的應用程式。

當您建立篩選條件時,請輸入要在篩選中使用的應用程式或裝置屬性。 例如:

  • 在受控裝置篩選器中,輸入裝置製造商,讓原則僅適用於 Microsoft 裝置。
  • 在受控應用程式篩選器中,輸入OS版本,讓原則僅適用於具有該特定作業系統版本的裝置。

進階規則編輯也可供使用。 您可以使用一般運算符,例如 andcontainsstartsWith 來建立表示式。 這些表達式會儲存並用於篩選。

本文說明您可以在篩選中使用的不同受控 裝置屬性受控應用程式屬性操作員 ,並提供範例。

重要事項

Microsoft Intune 於 2024 年 8 月 30 日終止對可存取 Google 行動服務 (GMS) 之裝置上的 Android 裝置系統管理員管理支援。 在該日期之後,裝置註冊、技術支援、錯誤修正和安全性修正將無法使用。 如果您目前使用裝置系統管理員管理,建議您在支持結束之前,切換至 Intune 中的另一個 Android 管理選項。 如需詳細資訊,請參閱 終止 GMS 裝置上的 Android 裝置系統管理員支援

Managed 裝置屬性

您可以在受控裝置篩選規則中使用下列裝置屬性:

  • deviceName (裝置名稱) :根據 Intune 裝置名稱屬性建立篩選規則。 使用 、、、 -in運算符) 或部分值 (, (使用 -startswith-eq-contains-notcontains-ne、 運算符) ,輸入裝置完整名稱的字串值。-notIn

    範例:

    • (device.deviceName -eq "Scott's Device")
    • (device.deviceName -in ["Scott's device", "Sara's device"])
    • (device.deviceName -startsWith "S")

    此屬性適用於:

    • Android 裝置系統管理員
    • Android Enterprise
    • Android (AOSP)
    • iOS/iPadOS
    • macOS
    • Windows 11
    • Windows 10
  • manufacturer (製造商) :根據 Intune 裝置製造商屬性建立篩選規則。 使用 -eq-ne-in-notIn運算子) 或部分值輸入 (的完整字串值, (使用 -startswith-contains-notcontains 運算子) 。

    範例:

    • (device.manufacturer -eq "Microsoft")
    • (device.manufacturer -startsWith "Micro")

    此屬性適用於:

    • Android 裝置系統管理員
    • Android Enterprise
    • Android (AOSP)
    • iOS/iPadOS
    • macOS
    • Windows 11
    • Windows 10
  • model (模型) :根據 Intune 裝置型號屬性建立篩選規則。 使用 -eq-ne-in-notIn運算子) 或部分值輸入 (的完整字串值, (使用 -startswith-contains-notcontains 運算子) 。

    針對 iOS/iPadOS 和 macOS 裝置,請使用模型,而不是產品名稱。 只有 Apple 裝置可以辨識模型。 例如,針對 iPhone 8 裝置,請將模型輸入為 iPhone 8

    範例:

    • (device.model -eq "Surface Book 3")
    • (device.model -in ["Surface Book 3", "Surface Book 2"])
    • (device.model -startsWith "Surface Book")
    • (device.model -startsWith "MacBookPro")
    • (device.model -startsWith "iPhone 8")

    此屬性適用於:

    • Android 裝置系統管理員
    • Android Enterprise
    • Android (AOSP)
    • iOS/iPadOS
    • macOS
    • Windows 11
    • Windows 10
  • deviceCategory (裝置類別目錄) :根據 Intune 裝置類別屬性建立篩選規則。 使用 -eq-ne-in-notIn運算子) 或部分值輸入 (的完整字串值, (使用 -startswith-contains-notcontains 運算子) 。

    範例:

    • (device.deviceCategory -eq "Engineering devices")
    • (device.deviceCategory -contains "Engineering")
    • (device.model -startsWith "E")

    此屬性適用於:

    • Android 裝置系統管理員
    • Android Enterprise
    • Android (AOSP)
    • iOS/iPadOS
    • macOS
    • Windows 11
    • Windows 10
  • osVersion (操作系統版本) :根據 Intune 裝置作業系統 (OS) 版本建立篩選規則。 使用 -eq-ne-in-notIn運算子) 或部分值輸入 (的完整字串值, (使用 -startswith-contains-notcontains 運算子) 。

    範例:

    • (device.osVersion -eq "14.2.1")
    • (device.osVersion -in ["10.15.3 (19D2064)","10.14.2 (18C54)"])
    • (device.osVersion -startsWith "10.0.18362")

    此屬性適用於:

    • Android 裝置系統管理員
    • Android Enterprise
    • Android (AOSP)
    • iOS/iPadOS
    • macOS
    • Windows 11
    • Windows 10

    注意事項

    針對 Apple 裝置,屬性 OSversion 不包含 Apple 的安全性修補程式版本 (SPV) 資訊。 SPV 是版本號碼後面的字母,例如 14.1.2a。 建立 Apple 裝置的篩選時,請勿在規則語法中 OSversion 包含 SPV。

  • IsRooted (Root 或 jailbroken) :根據裝置的 root root (Android) 或 (iOS/iPadOS) 裝置屬性建立篩選規則。 使用和運算子選True取、 False或未知的-eq-ne值。

    例如:

    • (device.isRooted -eq "True")

    此屬性適用於:

    • Android 裝置系統管理員
    • 僅限 Android Enterprise (Work 配置檔)
    • Android (AOSP)
    • iOS/iPadOS
  • deviceOwnership (擁有權) :根據裝置在 Intune 中的擁有權屬性建立篩選規則。 使用和運算子選Personal取、 Corporate或未知的-eq-ne值。

    例如:

    • (device.deviceOwnership -eq "Personal")

    此屬性適用於:

    • Android 裝置系統管理員
    • Android Enterprise
    • Android (AOSP)
    • iOS/iPadOS
    • macOS
    • Windows 11
    • Windows 10
  • enrollmentProfileName (註冊配置檔名稱) :根據註冊配置檔名稱建立篩選規則。 此屬性會在裝置註冊時套用至裝置。 這是您所建立的字串值,符合套用至裝置的 Windows Autopilot、Apple Automated Device Enrollment (ADE) 或 Google 註冊配置檔。 若要查看您的註冊配置檔名稱,請登入 Intune 系統管理中心,然後移至裝置>註冊裝置

    使用 -eq-ne-in-notIn運算子) 或部分值輸入 (的完整字串值, (使用 -startswith-contains-notcontains 運算子) 。

    範例:

    • (device.enrollmentProfileName -eq "DEP iPhones")
    • (device.enrollmentProfileName -startsWith "Autopilot Profile")
    • (device.enrollmentProfileName -ne $null)

    此屬性適用於:

    • Android Enterprise
    • Android (AOSP)
    • iOS/iPadOS
    • Windows 11
    • Windows 10
  • deviceTrustType (Microsoft Entra 聯結類型) :根據裝置的 Microsoft Entra 聯結類型建立篩選規則。 選擇已加入 Azure AD、已註冊 Azure AD、已加入混合式 Azure AD,或 (-eq使用 、 -ne-in-notIn 運算子) 的未知值。

    範例:

    • (device.deviceTrustType -eq "Azure AD joined")
    • (device.deviceTrustType -ne "Azure AD registered")
    • (device.deviceTrustType -in ["Hybrid Azure AD joined","Azure AD joined"])

    此屬性適用於:

    • Windows 11
    • Windows 10

    注意事項

    屬性deviceTrustType存在於 Microsoft Entra ID 和 Intune 中。 此 Intune 篩選發行項中的值會套用至 Intune。 它們不適用於 Microsoft Entra ID。

  • operatingSystemSKU (操作系統 SKU) :根據裝置的 Windows 用戶端 OS SKU 建立篩選規則。 使用 -eq-ne-in-notIn運算子) 或部分值輸入 (的完整字串值, (使用 -startswith-contains-notcontains 運算子) 。

    範例:

    • (device.operatingSystemSKU -eq "Enterprise")
    • (device.operatingSystemSKU -in ["Enterprise", "EnterpriseS", "EnterpriseN", "EnterpriseEval"])
    • (device.operatingSystemSKU -startsWith "Enterprise")

    您可以針對 作業系統 SKU 屬性使用下列支援的值。 Intune 系統管理中心不會顯示 SKU 名稱。 因此,請務必使用下表中支援的值:

    支援的值 OS SKU 定義
    BusinessN Windows 10/11 Professional N (49)
    CloudEdition CloudEdition (Windows 11 SE (203)
    CloudEditionN CloudEditionN (Windows 11 SE N (202)
    核心版 Windows 10/11 首頁 (10/111)
    CoreCountrySpecific Windows 10/11 首頁中國 (99)
    CoreN Windows 10/11 首頁 N (98)
    CoreSingleLanguage Windows 10/11 首頁單一語言 (100)
    教育 Windows 10/11 教育 (121)
    EducationN Windows 10/11 教育 (122)
    企業 Windows 10/11 企業 (4)
    EnterpriseEval Windows 10/11 企業評估 (72)
    EnterpriseG Windows 10/11 企業版 G (171)
    EnterpriseGN Windows 10/11 企業版 G N (172)
    EnterpriseN Windows 10/11 Enterprise N (27)
    EnterpriseNEval Windows 10/11 Enterprise N Evaluation (84)
    企業 Windows 10 企業版 LTSC (125)
    EnterpriseSEval Windows 10 企業版 LTSC 評估 (129)
    EnterpriseSN Windows 10 企業版 LTSC N (126)
    全息 Windows 10 全像攝影版 (136)
    IoTUAP Windows 10 IoT 核心版 (123)
    IoTUAPCommercial Windows 10 IoT 核心版 商業 (131)
    IoTEnterprise Windows 10/11 IoT 企業 (188)
    PPIPro Windows 10 TeamOS (119)
    Professional Windows 10/11 Professional (48)
    ProfessionalEducation Windows 10/11 專業教育 (164)
    ProfessionalEducationN Windows 10/11 專業教育版 N (165)
    ProfessionalWorkstation Windows 10/11 Professional for workstation (161)
    ProfessionalN Windows 10/11 Professional for workstation N (162)
    ProfessionalSingleLanguage Windows 10/11 專業單一語言 (138)
    ServerRdsh Windows 10/11 企業版多重會話 (175)

    此屬性適用於:

    • Windows 11
    • Windows 10

提示

在 Windows PowerShell 中,使用 Get-WmiObject -Class Win32_OperatingSystem |select operatingsystemSKU Windows 裝置上的 命令來傳回 SKU 號碼。

Managed 應用程式屬性

您可以在受控應用程式篩選規則中使用下列應用程式屬性:

  • appVersion (應用程式版本) :根據用戶端報告的應用程式版本建立篩選規則。 使用 -eq-ne-in-notIn運算子) 或部分值輸入 (的完整字串值, (使用 -startswith-contains-notcontains 運算子) 。

    範例:

    • (app.appVersion -eq "14.2.1")
    • (app.appVersion -in ["10.15.3","10.14.2"])
    • (app.appVersion -startsWith "10.0")

    此屬性適用於:

    • Android
    • iOS/iPadOS
    • Windows
  • deviceManagementType (裝置管理 類型) :在 Intune 註冊的裝置上,根據 Intune 裝置管理類型建立篩選規則。 裝置必須 Intune 註冊,才能使用此應用程式屬性。 使用與 -ne 運算-eq子從下列值中選取:

    支援的平台
    Unmanaged Android
    iOS/iPadOS
    Managed iOS/iPadOS
    Android device administrator Android
    Android Enterprise Android
    AOSP userless devices Android
    AOSP user-associated devices Android
    Corporate-owned dedicated devices with Azure AD Shared mode Android

    例如:

    • (app.deviceManagementType -eq "Unmanaged")

    此屬性適用:

    • Android
    • iOS/iPadOS
  • deviceManufacturer (製造商) :根據用戶端回報的裝置製造商建立篩選規則。 使用 -eq-ne-in-notIn運算子) 或部分值輸入 (的完整字串值, (使用 -startswith-contains-notcontains 運算子) 。

    範例:

    • (app.deviceManufacturer -eq "Microsoft")
    • (app.deviceManufacturer -startsWith "Micro")

    此屬性適用:

    • Android
    • iOS/iPadOS
    • Windows
  • deviceModel (模型) :根據用戶端報告的裝置型號建立篩選規則。 使用 -eq-ne-in-notIn運算子) 或部分值輸入 (的完整字串值, (使用 -startswith-contains-notcontains 運算子) 。

    範例:

    • (app.deviceModel -eq "Surface Duo")
    • (app.deviceModel -in ["Surface Duo", "Surface Duo 2"])
    • (app.deviceModel -startsWith "Surface Duo")

    此屬性適用於:

    • Android
    • iOS/iPadOS
    • Windows
  • osVersion (操作系統版本) :根據客戶端回報的作業系統 (OS) 版本建立篩選規則。 使用 -eq-ne-in-notIn運算子) 或部分值輸入 (的完整字串值, (使用 -startswith-contains-notcontains 運算子) 。

    範例:

    • (app.osVersion -eq "14.2.1")
    • (app.osVersion -in ["10.15.3","10.14.2"])
    • (app.osVersion -startsWith "10.0")

    此屬性適用於:

    • Android
    • iOS/iPadOS
    • Windows

進階規則編輯

當您建立篩選條件時,可以在規則語法編輯器中手動建立簡單或複雜的規則。 您也可以使用通用運算符,例如 orcontains等等。 格式類似於動態群組 Microsoft Entra:([entity].[property name] [operation] [value])

您需要知道的事項

  • 屬性、作業和值不區分大小寫。

  • 支援括弧和巢狀括弧。

  • 您可以使用 Null$Null 做為 和運算子的-NotEquals-Equals值。

  • 某些進階語法選項,例如巢狀括弧,只能在規則語法編輯器中使用。 如果您在規則語法編輯器中使用進階表達式,則會停用規則產生器。

    如需規則語法編輯器和規則產生器的詳細資訊,請移至 在指派應用程式、原則和配置檔時使用篩選

支援的運算子

您可以在規則語法編輯器中使用下列運算子:

  • 或者:用於所有實值型別,特別是在將簡單規則分組時。

    • 允許的值-or | or
    • 範例(device.manufacturer -eq "Samsung") or (device.model -contains "Galaxy Note")
  • 此外:適用於所有實值型別,特別是在將簡單規則分組時。

    • 允許的值-and | and
    • 範例(device.manufacturer -eq "Samsung") and (device.model -contains "Galaxy Note")
  • 等於:用於所有實值類型,包括簡單規則、字串、陣列等等。

    • 允許的值-eq | eq
    • 範例(device.manufacturer -eq "Samsung") and (device.model -eq "Galaxy Note")
  • NotEquals:用於所有實值類型,包括簡單規則、字串、陣列等等。

    • 允許的值-ne | ne
    • 範例(device.manufacturer -ne "Samsung") or (device.model -ne "Galaxy Note")
  • StartsWith:用於字串實值型別。

    • 允許的值-startsWith | startsWith
    • 範例(device.manufacturer -startsWith "Sams")
  • 中:用於陣列實值型別,例如 ["1", "2"]

    • 允許的值-in | in
    • 範例(device.manufacturer -in ["Samsung","Lenovo","Microsoft"])
  • NotIn:用於陣列實值型別,例如 ["1", "2"]

    • 允許的值-notIn | notIn
    • 範例(device.manufacturer -notIn ["Samsung","Lenovo","Microsoft"])
  • 包含:用於字串實值型別。

    • 允許的值-contains | contains
    • 範例(device.manufacturer -contains "Samsung")
  • NotContains:用於字串實值型別。

    • 允許的值-notContains | notContains
    • 範例(device.manufacturer -notContains "Samsung")

後續步驟