简体   繁体   English

过滤 Azure Active Directory 组

[英]Filtering Azure Active Directory Groups

I want to get all the groups from azure AD where the group name contains 'Glorea'.我想从 azure AD 中获取组名包含“Glorea”的所有组。

Any one knows the azure ad command?有人知道 azure 广告命令吗?

Please post here请在这里发帖

Regards Akhil问候阿基尔

As far as I know, AD has not implemented this feature currently.据我所知,AD目前还没有实现这个功能。 If we use microsoft graph api , we can just do " startwith " to filter the displayName of AD groups but can't do "contains" filter.如果我们使用microsoft graph api ,我们可以只做“ startwith ”过滤广告组的displayName,但不能做“contains”过滤。

In this document about powershell, the example2 shows us use this command Get-AzureADGroup -SearchString "All" can get the groups that include the text "All" in their display names.在这篇关于 powershell 的文档中,example2 向我们展示了使用此命令Get-AzureADGroup -SearchString "All"可以获得显示名称中包含文本“All”的组。 But according to my test, it also do the filter "startwith" but not "contains".但根据我的测试,它也做过滤器“startwith”而不是“contains”。 在此处输入图像描述

So for this requirement, we can just get all of the groups by graph api and do the "contains" filter by self in our code.因此,对于这个要求,我们可以通过图 api 获取所有组,并在我们的代码中通过 self 进行“包含”过滤。 Or you can vote up for this feature on feedback page .或者您可以在反馈页面上投票支持此功能。

Update:更新:

According to some test, I provide a workaround as below for your reference.根据一些测试,我提供了如下解决方法供您参考。

If we use powershell command, we can use the command below to implement the "contains":如果我们使用 powershell 命令,我们可以使用下面的命令来实现“包含”:

Get-AzureADGroup | Where-Object{($_.DisplayName -like '*test*')}

I figure it out piping where-object我弄清楚管道 where-object

Where-Object{($_.DisplayName -like ' test ')} Where-Object{($_.DisplayName -like ' test ')}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM