gpt4 book ai didi

azure - 使用 Get-AzureAdUser 有没有办法从源 "windows server ad"拉回所有用户?

转载 作者:行者123 更新时间:2023-12-01 13:15:37 25 4
gpt4 key购买 nike

我有一个包含大约 20 万用户的目录。我需要撤回来自本地 AD 的所有用户。这当然会排除多个源 guest 用户。我必须使用源,因为并非所有用户都有用户类型。

如果有一种方法可以搜索不等于 null 的 Department,也可以,但它似乎不是 odata 过滤器标准的一部分。

Get-AzureADUser -Filter "Department eq ''"  | select DisplayName,`
UserPrincipalName,Mail,creationType,AccountEnabled,Department

最佳答案

要获取来自本地 AD 的用户,您可以执行以下操作

 Get-AzureADUser -Filter "dirSyncEnabled eq true"

如果只选择少数,也可以使用其他运算符,例如 top ......例如

 Get-AzureADUser -top 5 -Filter "dirSyncEnabled eq true"

要一次性让所有用户都可以做到

Get-AzureADUser -All $true -Filter "dirSyncEnabled eq true"

Get-AzureADUser -all $true | where-object -property DirSyncEnabled -eq "True"

关于azure - 使用 Get-AzureAdUser 有没有办法从源 "windows server ad"拉回所有用户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55424760/

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