2008-09-16 24 views
7

Powershellを使用してアクティブディレクトリグループを別の組織単位に移動するにはどうすればよいですか?Powershellを使用してActive Directoryグループを別のOUに移動

ie。

Iからグループ "IT部門" に移動したいと思います:

(CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca) 

へ:私はこれをまだ試していない

(CN=IT Department, OU=Temporarily Moved Groups, DC=Company,DC=ca) 

答えて

6

あなたのスクリプトは本当に正しいものでした(本当にありがとう)。

次のスクリプトは、私は私の問題を解決するために使用するものです。:

$from = [ADSI]"LDAP://CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca" 
$to = [ADSI]"LDAP://OU=Temporarily Moved Groups, DC=Company,DC=ca" 
$from.PSBase.MoveTo($to,"cn="+$from.name) 
+0

グレート!アップデートを投稿していただきありがとうございます! –

3

が、これはそれを行う必要があります。..

$objectlocation= 'CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca' 
$newlocation = 'OU=Temporarily Moved Groups, DC=Company,DC=ca' 

$from = new-object System.DirectoryServices.DirectoryEntry("LDAP://$objectLocation") 
$to = new-object System.DirectoryServices.DirectoryEntry("LDAP://$newlocation") 
$from.MoveTo($newlocation,$from.name) 
関連する問題