2017-10-05 38 views
1

我需要找到具有以特定字符串結尾的proxyAddress的用戶和組,例如, @acme.com使用Microsoft Graph API在proxyAddresses上進行篩選,結束於或包含字符串

我可以做startsWith:

$filter=proxyAddresses/any(x:startswith(x,'smtp:johndoe')) 

或者等於:

$filter=proxyAddresses/any(x:x eq 'smtp:[email protected]') 

不過的endsWith,包含像似乎不工作:

$filter=proxyAddresses/any(x:contains(x,'*@acme.com')) 

和結果錯誤的請求。

回答

0

Microsoft Graph端點不支持endsWith,並且支持contains的端點數量有限。在這種情況下,Azure AD實體不支持contains。從documentation on $filter

注:以下$filter運營商不支持Azure的AD資源:negtgeltlenot。目前在任何Microsoft Graph資源上都不支持contains字符串運算符。

另外,您用於contains的語法也有點偏離。正確的語法是contains({property},'{subString}')。它類似於startsWith,不需要/支持通配符。

+0

謝謝馬克!你知道有沒有計劃支持endsWith或contains?爲了強大的搜索功能,目前它似乎非常有限 –

+0

我還沒有聽到有關'endsWith'的任何信息,但我知道有很多開發人員對支持'contains'感興趣。然而,這不是微不足道的,所以我不想在ETA上猜測它。 –

+0

Michael,請提出申請,請求UserVoice上的endsWith或contains:https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/category/101632-microsoft-graph-o365-rest-apis –

相關問題