You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何按appOwnerOrganizationId为空筛选Microsoft Entra服务主体?

筛选Azure AD服务主体的问题记录

可正常执行的筛选操作

  • 按所属租户筛选服务主体:
    get-mgserviceprincipal `
    -filter "appOwnerOrganizationId eq f8cdef31-a31e-4b4a-93e4-5f571e91255a" ` 
    -top 5 -ConsistencyLevel eventual -CountVariable thecount
    
  • 筛选不属于特定租户的服务主体:
    get-mgserviceprincipal `
    -filter "NOT (appOwnerOrganizationId eq f8cdef31-a31e-4b4a-93e4-5f571e91255a)" ` 
    -top 5 `
    -ConsistencyLevel eventual `
    -CountVariable thecount
    

无法解决的筛选场景

尝试筛选appOwnerOrganizationId为null的服务主体时触发查询错误。由于appOwnerOrganizationId定义为Edm.Guid类型,无法与空字符串''比较,尝试使用$null、$$null或null进行比较均返回以下错误:

Get-MgServicePrincipal_List: Unsupported Query.

内容的提问来源于stack exchange,提问作者Mark Mascolino

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 20:27:04