Office365 如何使用createdDateTime筛选器作为IdentityLiskeEvents图形api?

Office365 如何使用createdDateTime筛选器作为IdentityLiskeEvents图形api?,office365,azure-active-directory,microsoft-graph-api,Office365,Azure Active Directory,Microsoft Graph Api,现在我正在使用$url=“$url=“?”来查询beta identityRiskEvents Graph api。我可以循环通过“@odata.nextLink”并检索所有事件ID。但看起来它可能会上升到$skip=5100,然后失败 因此,我正在寻找一个带有createdDateTime或此URL中提到的任何其他属性的筛选器查询 尝试了解这些东西如何与powershell一起工作,即调用WebRequest 感谢您的帮助。使用$filter查询参数仅检索集合的一个子集。请参阅:。在您的情况下

现在我正在使用$url=“$url=“?”来查询beta identityRiskEvents Graph api。我可以循环通过“@odata.nextLink”并检索所有事件ID。但看起来它可能会上升到$skip=5100,然后失败

因此,我正在寻找一个带有createdDateTime或此URL中提到的任何其他属性的筛选器查询

尝试了解这些东西如何与powershell一起工作,即调用WebRequest


感谢您的帮助。

使用$filter查询参数仅检索集合的一个子集。请参阅:。

在您的情况下,您需要在$filter之前使用转义字符,或者使用取消最新字符并使美元符号用作字符$,而不是用作变量起始标记的反勾号

如果要传递$filter,请在美元符号前加上反勾。由于需要将$mark传递到url,并且如果只放置$filter,则会删除$filter,因为它是变量标记的开始,如果没有名为$filter的变量,则不会将任何输出作为空变量

您可以自行测试编写一个文本文件并在其中附加一个美元符号。 如果您将其设置为“$filter”,它将成为$filter

您需要删除该美元的特殊含义,并告知它将作为静态美元处理,没有特殊性

下一步是可能的url过滤器,这些过滤器已验证有效

# Select 1 record:
$url = "https://graph.microsoft.com/beta/identityRiskEvents?`$top=1"

# Select by createdDateTime yyyy-MM-dd
$url = "https://graph.microsoft.com/beta/identityRiskEvents?`$filter=createdDateTime ge XXXX-XX-XX"

# Select by user account
$url = "https://graph.microsoft.com/beta/identityRiskEvents?`$filter=userPrincipalName eq 'username@domainsuffix'"

# Select by user and createdDateTime
$url = "https://graph.microsoft.com/beta/identityRiskEvents?`$filter=userPrincipalName eq 'username@domainsuffix' and createdDateTime ge xxxx-xx-xx"

我确实在输出中看到createdDateTime属性,根据URL,该属性应该用于过滤,但不起作用。我尝试了以下过滤URL,它们都会产生相同的结果$URL=“gt”2018-05-30T00:00:00Z'&$URL=“lt”2018-05-30T00:00:00Z'”