gpt4 book ai didi

azure - Get-AzureADUser [-Filter ] 命令示例

转载 作者:行者123 更新时间:2023-12-01 23:29:19 25 4
gpt4 key购买 nike

命令:Get-AzureADUser [-Filter ] 命令

msdn说参数-筛选指定 oData v3.0 过滤器语句。此参数控制返回哪些对象。

如何设置过滤器以获得与 Azure 模块 v1 命令相同的结果

Get-MsolUser -All| Where-Object {$_.isLicensed -eq "True"}| Select-Object UserPrincipalName -ExpandProperty Licenses|Select-Object UserPrincipalName -ExpandProperty ServiceStatus|Where-Object {$_.ProvisioningStatus -eq "Success" -and $_.ServicePlan.ServiceName -like "MCO*"}|select UserPrincipalName -Unique

我到处寻找设置过滤器的正确示例,但找不到,所以我最终来到了这里。我基本上是在尝试将 Azure 模块 v1 命令转换为 Azure 模块 v2 命令。

最佳答案

Get-AzureADUser [Filter]命令的一些示例如下:

Get-AzureADUser -Filter "DisplayName eq 'Juv Chan'"
Get-AzureADUser -Filter "DisplayName eq 'Juv Chan' and UserType eq 'Member'"

这遵循指定的 oData 3.0 过滤器语义 here .

请注意,Get-AzureADUser cmdlet 仅返回 4 个字段:

Object Id, Display Name, UserPrincipalName, UserType

因此,无法使用上面的 cmdlet 为上面的 v1 命令创建等效的 v2 命令。

针对上述内容测试的 AzureAD PowerShell v2 模块的版本是2.0.0.33https://www.powershellgallery.com/packages/AzureAD/2.0.0.33

关于azure - Get-AzureADUser [-Filter <String>] 命令示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41872903/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com