C# 使用Graph API检查(Active Directory)中存在的用户列表

C# 使用Graph API检查(Active Directory)中存在的用户列表,c#,asp.net-web-api,azure-active-directory,C#,Asp.net Web Api,Azure Active Directory,我需要检查Azure中针对active directory验证的用户列表。 这些用户不属于任何组。我将把用户列表传递给根目录,它必须在AD中检索用户是否有效。如果您希望查询Azure Active Directory,请在筛选器中使用带有多个or子句的GET查询。比如: httpgethttps://graph.windows.net/7fe877e6-a150-4992-bbfe-f517e304dfa0/users?api-版本=1.5&$filter=displayName eq'Elle

我需要检查Azure中针对active directory验证的用户列表。
这些用户不属于任何组。我将把用户列表传递给根目录,它必须在AD中检索用户是否有效。

如果您希望查询Azure Active Directory,请在筛选器中使用带有多个or子句的GET查询。比如:

httpgethttps://graph.windows.net/7fe877e6-a150-4992-bbfe-f517e304dfa0/users?api-版本=1.5&$filter=displayName eq'Ellen Adams'或displayName eq'
Aaron Painter'或displayName eq'John Yokum'

筛选器还支持对其他属性(如userPrincipalName)进行比较:

httpgethttps://graph.windows.net/7fe877e6-a150-4992-bbfe-f517e304dfa0/users?api-版本=1.5&$filter=userPrincipalName eq'EllenA@aaddemo.com”“还是用
rPrincipalName eq'AaronP@aaddemo.com'或userPrincipalName eq'JohnY@aaddemo.com“

请参见此处过滤器上的参考文档:

此外,如果用户数量非常大(超过查询字符串限制),则批处理多个请求

最后,以下是一些调用Graph API的示例应用程序:

希望有帮助