次の方法で共有


Microsoft Entra ID オブジェクトの高度なクエリ機能

Microsoft Entra が安定性、可用性、パフォーマンスにおいてより多くの機能と改善を提供し続けるにつれて、Microsoft Graph も進化と拡張を続け、データに効率的にアクセスできるようになります。 1 つの方法は、さまざまな Microsoft Entra ID オブジェクト (ディレクトリ オブジェクトとも呼ばれます) とそのプロパティでの詳細クエリ機能に対する Microsoft Graph のサポートを増加することにより実現します。 たとえば、 not (not)、not equals (ne)、ends with (endsWith) 演算子を$filter クエリ パラメーターに追加します。

Microsoft Graph クエリ エンジンは、インデックス ストアを使用してクエリ要求を実行します。 一部のプロパティでクエリ機能のサポートを追加するために、これらのプロパティは別のストアでインデックス付けされるようになりました。 この個別のインデックス作成により、Microsoft Entra ID はサポートを強化し、クエリ要求のパフォーマンスを向上させることができます。 ただし、これらの高度なクエリ機能は既定では使用できませんが、要求者は ConsistencyLevel ヘッダー を eventual に設定する必要があります。ただし$search を除いて、$count クエリ パラメーターを使用します。 ConsistencyLevel ヘッダーと $count は、詳細クエリ パラメーターと呼ばれます。

たとえば、非アクティブなユーザー アカウントのみを取得する場合は、$filter クエリ パラメーターを使用するこれらのクエリのいずれかを実行できます。

オプション 1:eq 演算子で $filter クエリ パラメーターを使用します。 この要求は既定で機能します。つまり、要求は詳細クエリ パラメーターを必要としません。

GET https://graph.microsoft.com/v1.0/users?$filter=accountEnabled eq false

オプション 2:ne 演算子で $filter クエリ パラメーターを使用します。 ne 演算子は詳細クエリでのみサポートされているため、この要求は既定ではサポートされていません。 したがって、ConsistencyLevel ヘッダー セットを eventual に追加するとともに$count=true クエリ文字列を使用する必要があります。

GET https://graph.microsoft.com/v1.0/users?$filter=accountEnabled ne true&$count=true
ConsistencyLevel: eventual

高度なクエリ機能をサポートする Microsoft Entra ID (ディレクトリ) オブジェクト

これらの高度なクエリ機能は、ディレクトリ オブジェクトと、以下の頻繁に使用されるオブジェクトを含む、そのリレーションシップのサブセットでのみサポートされます。

オブジェクト リレーションシップ
administrativeUnit
  • members
  • application
  • 所有者
  • appRoleAssignment -
    device
  • memberOf
  • transitiveMemberOf
  • registeredUsers
  • registeredOwners
  • group
  • members
  • transitiveMembers
  • memberOf
  • transitiveMemberOf
  • 所有者
  • appRoleAssignments
  • oAuth2PermissionGrant (委任されたアクセス許可の付与) -
    orgContact
  • memberOf
  • transitiveMemberOf
  • servicePrincipal
  • memberOf
  • transitiveMemberOf
  • appRoleAssignments
  • appRoleAssignmentsTo
  • oAuth2PermissionGrant
  • user
  • memberOf
  • transitiveMemberOf
  • ownedObjects
  • registeredDevices
  • ownedDevices
  • transitiveManagers
  • directReports
  • transitiveReports
  • appRoleAssignments
  • oAuth2PermissionGrant
  • 高度なクエリ機能を必要とするクエリ シナリオ

    次の表に、詳細クエリでのみサポートされるディレクトリ オブジェクトのクエリ シナリオを示します。

    説明
    URL セグメントとしての $count の使用 GET~/groups/$count
    クエリ文字列パラメーターとしての $count の使用 GET~/servicePrincipals?$count=true
    $filter式での$countの使用 GET~/users?$filter=assignedLicenses/$count eq 0&$count=true
    $search の使用 GET~/applications?$search="displayName:Browser"
    一部のプロパティでの $orderby の使用 GET~/applications?$orderby=displayName&$count=true
    endsWith 演算子での $filter の使用 GET~/users?$count=true&$filter=endsWith(mail,'@outlook.com')
    同じクエリでの $filter$orderby の使用 GET../applications?$orderby=displayName&$filter=startsWith(displayName, 'Box')&$count=true
    特定のプロパティの startsWith 演算子での $filter の使用。 GET~/users?$filter=startsWith(mobilePhone, '25478') OR startsWith(mobilePhone, '25473')&$count=true
    ne および not 演算子と $filter の使用 GET~/users?$filter=companyName ne null and NOT(companyName eq 'Microsoft')&$count=true
    not および startsWith 演算子と $filter の使用 GET~/users?$filter=NOT startsWith(displayName, 'Conf')&$count=true
    endsWith 演算子を使用したコレクションにおける $filter の使用 GET~/users?$count=true&$filter=proxyAddresses/any (p:endsWith(p, 'contoso.com'))&$select=id,displayName,proxyaddresses
    遷移的なメンバーリストでの OData キャストの使用 GET~/me/transitiveMemberOf/microsoft.graph.group?$count=true

    注:

    • $filter$orderbyの併用は、高度なクエリでのみサポートされます。
    • $expand は、現在、高度なクエリではサポートされていません。
    • 現在、高度なクエリ機能は、Azure AD B2C テナントでは使用できません。
    • バッチ要求で高度なクエリ機能を使用するには、POST 要求の JSON 本文で ConsistencyLevel ヘッダーを指定します。

    Microsoft Entra ID (ディレクトリ) オブジェクトのプロパティによるフィルターのサポート

    ディレクトリ オブジェクトのプロパティは、クエリ パラメーターのサポートにおいて異なる動作をします。 ディレクトリ オブジェクトの一般的なシナリオは次のとおりです。

    • 既定でサポートされているクエリは高度なクエリ パラメーターでも機能しますが、最終的には応答が一貫したものになります。
    • in演算子は、eq演算子が既定でサポートされる場合はいつでも、既定でサポートされます。
    • endsWith 演算子は、 mailotherMailsuserPrincipalNameproxyAddresses プロパティに対する高度なクエリ パラメーターでのみサポートされます。
    • 空のコレクション (/$count eq 0/$count ne 0) と 1 つ未満のオブジェクトを持つコレクション (/$count eq 1/$count ne 1) の取得は、高度なクエリ パラメーターでのみサポートされます。
    • not およびne 否定演算子は、高度なクエリ パラメーターでのみサポートされます。
      • eq 演算子をサポートするすべてのプロパティは、ne または not 演算子もサポートします。
      • any ラムダ演算子を使用するクエリの場合は、not 演算子を使用します。 「ラムダ演算子を使用したフィルター」を参照してください。

    次の表は、ディレクトリ オブジェクトのプロパティによる $filter 演算子のサポートをまとめたものであり、高度なクエリ機能を使用したクエリがサポートされる場所を示しています。

    凡例

    • 既定で動作します。高度なクエリ パラメーターは必要ありません。$filter 演算子は、そのプロパティに対して既定で機能します。
    • 高度なクエリ パラメーターが必要です。$filter 演算子には、次の高度なクエリ パラメーター必要です。
      • ConsistencyLevel=eventual ヘッダー
      • $count=true クエリ文字列
    • サポートされていません。$filter 演算子は、そのプロパティではサポートされません。 [フィードバックを送信] して、このプロパティがシナリオに $filter をサポートすることを要求します。
    • 空白のセルは、クエリがそのプロパティに対して無効であることを示します。
    • null 値列は、プロパティが null 許容であり、nullを使用してフィルター可能であることを示します。
    • ここに記載されていないプロパティは、$filter を一切サポートしました。

    管理単位のプロパティ

    プロパティ eq startsWith eq Null
    説明 Advanced Advanced Advanced Advanced Advanced Advanced
    displayName 既定の既定値 既定の既定値 Advanced Advanced
    isMemberManagementRestricted 既定の既定値 NotSupported
    membershipRule 既定の既定値 既定の既定値 NotSupported
    membershipRuleProcessingState 既定の既定値 NotSupported
    scopedRoleMembers/any(s:s/id) 既定の既定値

    アプリケーションのプロパティ

    プロパティ eq startsWith ge/le eq Null
    appId 既定の既定値
    createdDateTime 既定の既定値 既定の既定値 Advanced Advanced
    createdOnBehalfOf/id 既定の既定値
    説明 Advanced Advanced Advanced Advanced Advanced Advanced
    disabledByMicrosoftStatus 既定の既定値 NotSupported
    displayName 既定の既定値 既定の既定値 Advanced Advanced
    federatedIdentityCredentials/any(f:f/issuer) Advanced Advanced Advanced Advanced NotSupported
    federatedIdentityCredentials/any(f:f/name) Advanced Advanced Advanced Advanced NotSupported
    federatedIdentityCredentials/any(f:f/subject) Advanced Advanced Advanced Advanced NotSupported
    identifierUris/any(p:p) 既定の既定値 既定の既定値
    info/logoUrl NotSupported NotSupported Advanced Advanced
    info/termsOfServiceUrl Advanced Advanced Advanced Advanced NotSupported
    notes Advanced Advanced Advanced Advanced Advanced Advanced
    publicClient/redirectUris/any(p:p) Advanced Advanced Advanced Advanced
    publisherDomain 既定の既定値 既定の既定値 NotSupported
    requiredResourceAccess/any(r:r/resourceAppId) Advanced Advanced
    serviceManagementReference Advanced Advanced Advanced Advanced Advanced Advanced
    signInAudience 既定の既定値 NotSupported
    spa/redirectUris/any(p:p) Advanced Advanced Advanced Advanced
    tags/any(p:p) 既定の既定値 既定の既定値
    uniqueName 既定の既定値 既定の既定値 NotSupported
    verifiedPublisher/displayName Advanced Advanced Advanced Advanced Advanced Advanced
    web/homePageUrl Advanced Advanced Advanced Advanced Advanced Advanced
    web/redirectUris/any(p:p) Advanced Advanced Advanced Advanced

    アプリケーション エンティティの次のプロパティは、フィルター式でのコレクションの $count をサポートしています。

    プロパティ eq Count 0 eq Count 1
    extensionProperties/$count Advanced Advanced NotSupported
    federatedIdentityCredentials/$count Advanced Advanced NotSupported

    コントラクト プロパティ

    プロパティ eq startsWith
    customerId 既定の既定値
    defaultDomainName 既定の既定値 既定の既定値
    displayName 既定の既定値 既定の既定値

    デバイス プロパティ

    プロパティ eq startsWith ge/le eq Null
    accountEnabled 既定の既定値 NotSupported
    alternativeSecurityIds/any(a:a/identityProvider) Advanced Advanced Advanced Advanced NotSupported
    alternativeSecurityIds/any(a:a/type) 既定の既定値 Advanced Advanced NotSupported
    approximateLastSignInDateTime 既定の既定値 既定の既定値 Advanced Advanced
    deviceCategory Advanced Advanced Advanced Advanced Advanced Advanced
    deviceId 既定の既定値
    deviceOwnership Advanced Advanced Advanced Advanced
    displayName 既定の既定値 既定の既定値 Advanced Advanced
    enrollmentProfileName Advanced Advanced Advanced Advanced Advanced Advanced
    extensionAttributes/extensionAttribute1-15 Advanced Advanced Advanced Advanced Advanced Advanced
    hostnames/any(p:p) 既定の既定値 既定の既定値
    isCompliant 既定の既定値 NotSupported
    isManaged 既定の既定値 NotSupported
    isRooted Advanced Advanced Advanced Advanced
    managementType Advanced Advanced Advanced Advanced
    manufacturer Advanced Advanced Advanced Advanced Advanced Advanced
    mdmAppId 既定の既定値
    model Advanced Advanced Advanced Advanced Advanced Advanced
    onPremisesLastSyncDateTime 既定の既定値 既定の既定値 NotSupported
    onPremisesSecurityIdentifier 既定の既定値 Advanced Advanced
    onPremisesSyncEnabled 既定の既定値 Advanced Advanced
    operatingSystem 既定の既定値 既定の既定値 Advanced Advanced
    operatingSystemVersion 既定の既定値 既定の既定値 Advanced Advanced
    physicalIds/any(p:p) 既定の既定値
    profileType 既定の既定値 NotSupported
    registrationDateTime Advanced Advanced Advanced Advanced Advanced Advanced
    trustType 既定の既定値 NotSupported

    device エンティティの次のプロパティは、フィルター式でのコレクションの $count をサポートしています。

    プロパティ eq Count 0 eq Count 1
    physicalIds/$count Advanced Advanced NotSupported
    systemLabels/$count Advanced Advanced NotSupported

    ディレクトリ ロールのプロパティ

    プロパティ eq startsWith eq Null
    説明 Advanced Advanced Advanced Advanced Advanced Advanced
    displayName 既定の既定値 Advanced Advanced Advanced Advanced
    roleTemplateId 既定の既定値 NotSupported

    グループのプロパティ

    プロパティ eq startsWith ge/le eq Null
    appRoleAssignments/any(a:a/id) 既定の既定値
    assignedLicenses/any(a:a/skuId) 既定の既定値
    classification 既定の既定値 既定の既定値 NotSupported
    createdByAppId 既定の既定値
    createdOnBehalfOf/id 既定の既定値
    説明 Advanced Advanced Advanced Advanced Advanced Advanced
    displayName 既定の既定値 既定の既定値 Advanced Advanced
    expirationDateTime Advanced Advanced Advanced Advanced NotSupported
    hasMembersWithLicenseErrors 既定の既定値 既定の既定値
    infoCatalogs/any(p:p) 既定の既定値 既定の既定値
    isAssignableToRole 既定の既定値 NotSupported
    mail 既定の既定値 既定の既定値 Advanced Advanced
    mailEnabled 既定の既定値 NotSupported
    mailNickname 既定の既定値 既定の既定値 Advanced Advanced
    membershipRule 既定の既定値 既定の既定値 NotSupported
    membershipRuleProcessingState 既定の既定値 NotSupported
    onPremisesLastSyncDateTime 既定の既定値 既定の既定値 NotSupported
    onPremisesProvisioningErrors/any(o:o/category) 既定の既定値 NotSupported
    onPremisesProvisioningErrors/any(o:o/propertyCausingError) 既定の既定値 NotSupported
    onPremisesSamAccountName Advanced Advanced Advanced Advanced NotSupported
    onPremisesSecurityIdentifier 既定の既定値 Advanced Advanced
    onPremisesSyncEnabled 既定の既定値 Advanced Advanced
    preferredLanguage Advanced Advanced Advanced Advanced Advanced Advanced
    proxyAddresses/any(p:p) 既定の既定値 既定の既定値
    renewedDateTime 既定の既定値 既定の既定値 NotSupported
    resourceBehaviorOptions/any(p:p) 既定の既定値
    resourceProvisioningOptions/any(p:p) 既定の既定値
    securityEnabled 既定の既定値 NotSupported
    settings/any(s:s/displayName) 既定の既定値 既定の既定値 NotSupported
    settings/any(s:s/id) 既定の既定値
    uniqueName 既定の既定値 既定の既定値 NotSupported

    group エンティティの次のプロパティは、フィルター式でのコレクションの $count をサポートしています。

    プロパティ eq Count 0 eq Count 1
    assignedLicenses/$count Advanced Advanced NotSupported
    onPremisesProvisioningErrors/$count Advanced Advanced NotSupported
    proxyAddresses/$count Advanced Advanced NotSupported

    組織の連絡先のプロパティ

    プロパティ eq startsWith ge/le eq Null
    CompanyName Advanced Advanced Advanced Advanced Advanced Advanced
    department 既定の既定値 既定の既定値 Advanced Advanced
    displayName 既定の既定値 既定の既定値 Advanced Advanced
    givenName 既定の既定値 既定の既定値 Advanced Advanced
    jobTitle 既定の既定値 既定の既定値 Advanced Advanced
    mail 既定の既定値 既定の既定値 Advanced Advanced
    mailNickname 既定の既定値 既定の既定値 Advanced Advanced
    manager/id 既定の既定値
    onPremisesLastSyncDateTime 既定の既定値 既定の既定値 NotSupported
    onPremisesProvisioningErrors/any(o:o/category) 既定の既定値 NotSupported
    onPremisesProvisioningErrors/any(o:o/propertyCausingError) 既定の既定値 NotSupported
    onPremisesSyncEnabled 既定の既定値 Advanced Advanced
    proxyAddresses/any(p:p) 既定の既定値 既定の既定値
    surname 既定の既定値 既定の既定値 Advanced Advanced

    orgContact エンティティの次のプロパティは、フィルター式でのコレクションの $count をサポートしています。

    プロパティ eq Count 0 eq Count 1
    onPremisesProvisioningErrors/$count Advanced Advanced NotSupported
    proxyAddresses/$count Advanced Advanced NotSupported

    サービス プリンシパルのプロパティ

    プロパティ eq startsWith ge/le eq Null
    accountEnabled 既定の既定値 NotSupported
    alternativeNames/any(p:p) 既定の既定値 既定の既定値
    appId 既定の既定値
    appOwnerOrganizationId Advanced Advanced
    appRoleAssignedTo/any(a:a/id) 既定の既定値
    appRoleAssignmentRequired Advanced Advanced NotSupported
    appRoleAssignments/any(a:a/id) 既定の既定値
    applicationTemplateId 既定の既定値
    createdObjects/any(c:c/id) Advanced Advanced
    delegatedPermissionClassifications/any(d:d/id) 既定の既定値
    説明 Advanced Advanced Advanced Advanced Advanced Advanced
    displayName 既定の既定値 既定の既定値 Advanced Advanced
    federatedIdentityCredentials/any(f:f/issuer) Advanced Advanced Advanced Advanced NotSupported
    federatedIdentityCredentials/any(f:f/name) Advanced Advanced Advanced Advanced NotSupported
    federatedIdentityCredentials/any(f:f/subject) Advanced Advanced Advanced Advanced NotSupported
    HomePage Advanced Advanced Advanced Advanced Advanced Advanced
    info/logoUrl NotSupported NotSupported Advanced Advanced
    info/termsOfServiceUrl Advanced Advanced Advanced Advanced NotSupported
    notes Advanced Advanced Advanced Advanced Advanced Advanced
    oauth2PermissionGrants/any(o:o/id) 既定の既定値
    preferredSingleSignOnMode 既定の既定値 NotSupported
    preferredTokenSigningKeyEndDateTime 既定の既定値 既定の既定値 NotSupported
    publisherName 既定の既定値 既定の既定値 NotSupported
    remoteDesktopSecurityConfiguration/id 既定の既定値
    remoteDesktopSecurityConfiguration/targetDeviceGroups/any(t:t/displayName) 既定の既定値 既定の既定値 NotSupported
    remoteDesktopSecurityConfiguration/targetDeviceGroups/any(t:t/id) 既定の既定値
    servicePrincipalNames/any(p:p) 既定の既定値 既定の既定値
    servicePrincipalType 既定の既定値 NotSupported
    tags/any(p:p) 既定の既定値 既定の既定値
    verifiedPublisher/displayName Advanced Advanced Advanced Advanced Advanced Advanced

    servicePrincipal エンティティの次のプロパティは、フィルター式でのコレクションの $count をサポートしています。

    プロパティ eq Count 0 eq Count 1
    federatedIdentityCredentials/$count Advanced Advanced NotSupported
    ownedObjects/$count Advanced Advanced Advanced Advanced

    ユーザーのプロパティ

    プロパティ eq startsWith ge/le eq Null
    accountEnabled 既定の既定値 NotSupported
    ageGroup 既定の既定値 NotSupported
    appRoleAssignments/any(a:a/id) 既定の既定値
    assignedLicenses/any(a:a/skuId) 既定の既定値
    assignedPlans/any(a:a/capabilityStatus) Advanced Advanced NotSupported
    assignedPlans/any(a:a/service) Advanced Advanced Advanced Advanced NotSupported
    assignedPlans/any(a:a/servicePlanId) Advanced Advanced
    authorizationInfo/certificateUserIds/any(p:p) Advanced Advanced
    businessPhones/any(p:p) Advanced Advanced Advanced Advanced
    city 既定の既定値 既定の既定値 Advanced Advanced
    cloudRealtimeCommunicationInfo/isSipEnabled 既定の既定値 NotSupported
    CompanyName Advanced Advanced Advanced Advanced Advanced Advanced
    consentProvidedForMinor 既定の既定値 NotSupported
    country 既定の既定値 既定の既定値 Advanced Advanced
    createdDateTime 既定の既定値 既定の既定値 Advanced Advanced
    createdObjects/any(c:c/id) Advanced Advanced
    creationType 既定の既定値 NotSupported
    department 既定の既定値 既定の既定値 Advanced Advanced
    displayName 既定の既定値 既定の既定値 Advanced Advanced
    employeeHireDate Advanced Advanced Advanced Advanced NotSupported
    employeeId 既定の既定値 Advanced Advanced
    employeeOrgData/costCenter Advanced Advanced Advanced Advanced NotSupported
    employeeOrgData/division Advanced Advanced Advanced Advanced NotSupported
    employeeType Advanced Advanced NotSupported
    externalUserState 既定の既定値 NotSupported
    faxNumber Advanced Advanced Advanced Advanced Advanced Advanced
    givenName 既定の既定値 既定の既定値 Advanced Advanced
    identities/any(i:i/issuer) 既定の既定値 NotSupported 既定の既定値
    imAddresses/any(p:p) 既定の既定値 既定の既定値
    infoCatalogs/any(p:p) 既定の既定値 既定の既定値
    isLicenseReconciliationNeeded 既定の既定値 NotSupported
    isResourceAccount 既定の既定値 NotSupported
    jobTitle 既定の既定値 既定の既定値 Advanced Advanced
    licenseDetails/any(l:l/id) 既定の既定値
    mail 既定の既定値 既定の既定値 Advanced Advanced
    mailNickname 既定の既定値 既定の既定値 Advanced Advanced
    manager/id NotSupported
    mobilePhone Advanced Advanced Advanced Advanced Advanced Advanced
    oauth2PermissionGrants/any(o:o/id) 既定の既定値
    officeLocation Advanced Advanced Advanced Advanced Advanced Advanced
    onPremisesDistinguishedName Advanced Advanced Advanced Advanced Advanced Advanced
    onPremisesExtensionAttributes/extensionAttribute1-15 Advanced Advanced Advanced Advanced Advanced Advanced
    onPremisesImmutableId 既定の既定値
    onPremisesLastSyncDateTime 既定の既定値 既定の既定値 NotSupported
    onPremisesProvisioningErrors/any(o:o/category) 既定の既定値 NotSupported
    onPremisesProvisioningErrors/any(o:o/propertyCausingError) 既定の既定値 NotSupported
    onPremisesSamAccountName Advanced Advanced Advanced Advanced NotSupported
    onPremisesSecurityIdentifier 既定の既定値 Advanced Advanced
    onPremisesSipInfo/isSipEnabled Advanced Advanced NotSupported
    onPremisesSyncEnabled 既定の既定値 Advanced Advanced
    otherMails/any(p:p) 既定の既定値 既定の既定値
    passwordPolicies NotSupported NotSupported Advanced Advanced
    passwordProfile/forceChangePasswordNextSignIn Advanced Advanced Advanced Advanced
    passwordProfile/forceChangePasswordNextSignInWithMfa Advanced Advanced Advanced Advanced
    postalCode Advanced Advanced Advanced Advanced Advanced Advanced
    preferredLanguage Advanced Advanced Advanced Advanced Advanced Advanced
    provisionedPlans/any(p:p/provisioningStatus) Advanced Advanced NotSupported
    provisionedPlans/any(p:p/service) Advanced Advanced Advanced Advanced NotSupported
    proxyAddresses/any(p:p) 既定の既定値 既定の既定値
    scopedRoleMemberOf/any(s:s/id) 既定の既定値
    showInAddressList Advanced Advanced NotSupported
    state 既定の既定値 Advanced Advanced
    streetAddress Advanced Advanced Advanced Advanced Advanced Advanced
    surname 既定の既定値 既定の既定値 Advanced Advanced
    usageLocation 既定の既定値 既定の既定値 Advanced Advanced
    userPrincipalName 既定の既定値 既定の既定値 NotSupported
    userType 既定の既定値 Advanced Advanced

    user エンティティの次のプロパティは、フィルター式でのコレクションの $count をサポートしています。

    プロパティ eq Count 0 eq Count 1
    assignedLicenses/$count Advanced Advanced NotSupported
    onPremisesProvisioningErrors/$count Advanced Advanced NotSupported
    otherMails/$count Advanced Advanced NotSupported
    ownedObjects/$count Advanced Advanced Advanced Advanced
    proxyAddresses/$count Advanced Advanced NotSupported

    次の表は、user オブジェクトの他の拡張プロパティによる $filter のサポートを示しています。

    拡張機能の種類 eq startsWith eq null
    スキーマ拡張機能 Advanced Advanced Advanced Advanced Advanced Advanced
    Open extensions NotSupported NotSupported NotSupported
    ディレクトリ拡張機能 既定の既定値 Advanced Advanced Advanced Advanced

    Microsoft Entra ID (ディレクトリ) オブジェクトのプロパティによる並べ替えのサポート

    次の表は、ディレクトリ オブジェクトのプロパティによる $orderby のサポートをまとめたものであり、高度なクエリ機能を使用した並べ替えがサポートされる場所を示しています。

    凡例

    • 既定で動作します。高度なクエリ パラメーターは必要ありません。$orderby 演算子は、そのプロパティに対して既定で機能します。
    • 高度なクエリ パラメーターが必要です。$orderby 演算子には、次の高度なクエリ パラメーター必要です。
      • ConsistencyLevel=eventual ヘッダー
      • $count=true クエリ文字列
    • ディレクトリ オブジェクトに対する同じクエリで $filter$orderby を使用するには、常に高度なクエリ パラメーターが必要です。 詳細については、「高度なクエリ機能を必要とするクエリ シナリオ」を参照してください。
    ディレクトリ オブジェクト プロパティ名 $orderby
    administrativeUnit createdDateTime Advanced Advanced
    administrativeUnit deletedDateTime Advanced Advanced
    administrativeUnit displayName Advanced Advanced
    アプリケーション createdDateTime Advanced Advanced
    アプリケーション deletedDateTime Advanced Advanced
    アプリケーション displayName Advanced Advanced
    orgContact createdDateTime Advanced Advanced
    orgContact displayName Advanced Advanced
    デバイス approximateLastSignInDateTime Advanced Advanced
    デバイス createdDateTime Advanced Advanced
    デバイス deletedDateTime Advanced Advanced
    デバイス displayName Advanced Advanced
    グループ deletedDateTime Advanced Advanced
    グループ displayName 既定の既定値
    servicePrincipal createdDateTime Advanced Advanced
    servicePrincipal deletedDateTime Advanced Advanced
    servicePrincipal displayName Advanced Advanced
    ユーザー createdDateTime Advanced Advanced
    ユーザー deletedDateTime Advanced Advanced
    ユーザー displayName 既定の既定値
    ユーザー userPrincipalName 既定の既定値
    [その他] [その他] NotSupported

    ディレクトリ オブジェクトの詳細クエリに対するエラー処理

    ディレクトリ オブジェクトのカウントは、詳細クエリ パラメーターの使用でのみサポートされます。 ConsistencyLevel=eventual ヘッダーが指定されていない場合、要求は、$count URL セグメントが使用されているときエラーを返し、$count クエリ パラメーター (?$count=true) が使用されているときサイレントに無視します。

    GET https://graph.microsoft.com/v1.0/users/$count
    
    {
        "error": {
            "code": "Request_BadRequest",
            "message": "$count is not currently supported.",
            "innerError": {
                "date": "2021-05-18T19:03:10",
                "request-id": "d9bbd4d8-bb2d-44e6-99a1-71a9516da744",
                "client-request-id": "539da3bd-942f-25db-636b-27f6f6e8eae4"
            }
        }
    }
    

    ディレクトリ オブジェクトの場合、 $search は高度なクエリでのみ機能します。 ConsistencyLevel ヘッダーが指定されていない場合、要求はエラーを返します。

    GET https://graph.microsoft.com/v1.0/applications?$search="displayName:Browser"
    
    {
        "error": {
            "code": "Request_UnsupportedQuery",
            "message": "Request with $search query parameter only works through MSGraph with a special request header: 'ConsistencyLevel: eventual'",
            "innerError": {
                "date": "2021-05-27T14:26:47",
                "request-id": "9b600954-ba11-4899-8ce9-6abad341f299",
                "client-request-id": "7964ef27-13a3-6ca4-ed7b-73c271110867"
            }
        }
    }
    

    URL のプロパティまたはクエリ パラメーターが詳細クエリでのみサポートされているが、ConsistencyLevel ヘッダーまたは $count=true クエリ文字列のいずれかが欠落している場合、要求はエラーを返します。

    GET https://graph.microsoft.com/beta/users?$filter=endsWith(userPrincipalName,'%23EXT%23@contoso.com')
    
    {
        "error": {
            "code": "Request_UnsupportedQuery",
            "message": "Operator 'endsWith' is not supported because the required parameters might be missing. Try adding $count=true query parameter and ConsistencyLevel:eventual header. Refer to https://aka.ms/graph-docs/advanced-queries for more information",
            "innerError": {
                "date": "2023-07-14T08:43:39",
                "request-id": "b3731da7-5c46-4c37-a8e5-b190124d2531",
                "client-request-id": "a1556ddf-4794-929d-0105-b753a78b4c68"
            }
        }
    }
    

    クエリ パラメーターをサポートするようにプロパティにインデックスが付けられていない場合、詳細クエリ パラメーターが指定されていても、要求はエラーを返します。

    GET https://graph.microsoft.com/beta/groups?$filter=createdDateTime ge 2021-11-01&$count=true
    ConsistencyLevel: eventual
    
    {
        "error": {
            "code": "Request_UnsupportedQuery",
            "message": "Unsupported or invalid query filter clause specified for property 'createdDateTime' of resource 'Group'.",
            "innerError": {
                "date": "2023-07-14T08:42:44",
                "request-id": "b6a5f998-94c8-430d-846d-2eaae3031492",
                "client-request-id": "2be83e05-649e-2508-bcd9-62e666168fc8"
            }
        }
    }
    

    ただし、クエリ パラメーターを含む要求は、サイレントに失敗する可能性があります。 たとえば、クエリ パラメーターがサポートされていない場合や、クエリ パラメーターの組み合わせがサポートされていない場合です。 その場合、要求によって返されたデータを調べ、指定したクエリ パラメーターに期待どおりの効果があったかどうかを確認してください。 たとえば、次の例では、クエリが成功の場合でも @odata.count パラメーターが欠落しています。

    GET https://graph.microsoft.com/v1.0/users?$count=true
    
    HTTP/1.1 200 OK
    Content-type: application/json
    
    {
      "@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users",
      "value":[
        {
          "displayName":"Oscar Ward",
          "mail":"oscarward@contoso.com",
          "userPrincipalName":"oscarward@contoso.com"
        }
      ]
    }