【问题标题】:How to move a user to a new Organizational Unit如何将用户移动到新的组织单位
【发布时间】:2015-03-19 08:13:48
【问题描述】:

使用命令行,我该怎么做:

  1. 将用户移至新的组织单位?
  2. 获取用户当前的组织单位?

【问题讨论】:

  • 从标题中删除标签;澄清首字​​母缩略词;调整问题的文本;去掉“谢谢”

标签: command-line active-directory command


【解决方案1】:
  1. Get-ADUser UserName | Move-ADObject -TargetPath (Get-ADOrganizationalUnit -Filter "Name -eq 'Your OU Name'")
  2. Get-ADUser UserName | Select DistinguishedName

这可能会对您有所帮助:Move Active Directory users with PowerShell

【讨论】:

    【解决方案2】:

    使用Powershell的ActiveDirectory-Module:

    Import-Module activedirectory
    Move-ADObject -Identity "CN=John Doe,OU=Accounting,DC=Fabrikam,DC=com" -TargetPath "OU=NewOU,DC=Fabrikam,DC=com"
    

    见:http://go.microsoft.com/fwlink/p/?linkid=291059

    还有:

    Import-Module activedirectory
    Get-ADUser -Identity foobar|FT DistinguishedName
    

    见:https://technet.microsoft.com/library/251aa5e1-8d5d-4eda-82b5-f0092b44ec3f%28v=wps.630%29.aspx

    在第二个示例中,您需要进行一些字符串处理以获取 OU

    【讨论】:

      猜你喜欢
      • 2021-12-27
      • 2017-08-20
      • 1970-01-01
      • 2020-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-28
      • 2020-02-02
      相关资源
      最近更新 更多