Active Directory:如何找到具有相同标题的用户的位置并复制它?

Active Directory : how to find the location of a user with the same title and copy it?

我正在尝试将新创建的用户移动到与具有相同标题的用户相同的文件夹中。

例如,如果用户 Becca 的头衔是“技术支持官”,而新创建的 Barney 的头衔是“技术支持官”,我希望能够将 Barney 移动到与 Becca 相同的文件夹中。

我对 PowerShell 和 Active Directory 模块还很陌生,所以非常感谢任何有用的提示或命令。

$folderloca = Get-ADGroup -filter * | Where-Object {$_.name -like "*TiTle*"} | select name

我的目标是按照上面的代码行做一些事情,但不太确定从这里到哪里去。

如何根据标题找到用户以及找到他们的位置?

I would like to search the domain for multiple people of the same title and then locate which Organizational Unit they are in.

您可以使用以下命令解决问题:

Get-ADUser -Filter * -Properties * |Where-Object{$_.Title -eq "testengineer"}| Select-Object Name,Title,DistinguishedName