我使用PowerShell的移動用戶在不同的領域不同的OU證書與未經Quest/ADAM /的cmdlet
[System.DirectoryServices.AccountManagement.UserPrincipal]::FindByIdentity($context, $idtype, $sam)
如何移動這就要用到一個新的OU?
我已經試過:
...
$user_adspath = $user.Properties.adspath
$user_ou = [ADSI]"$user_adspath"
$user_ou.PSBase.MoveTo("LDAP://$target")
我recive一個 「常規訪問被拒絕」 的錯誤。由於我需要權利這一事實。這工作雖然。
...
$user.description += " MOVED"
$user.Enabled = $False
$user.Save()
記住,這是沒有任務,ADAM非2008的服務器上一樣,cmdlet不工作。我有工作的唯一的事情是:
「添加型-AssemblyName System.DirectoryServices.AccountManagement」
我需要沿着此線的東西:
$user.MoveTo("LDAP://$target")
$user.Save()
這是我遇到麻煩的權限!我通過「[System.DirectoryServices.AccountManagement.UserPrincipal] :: FindByIdentity($ context,$ idtype,$ sam)」登錄到其他域,這將返回「$ user」,我用它來執行下列命令「 $ user.description + =「MOVED」 $ user.Enabled = $ False $ user.Save()「成功!因此,爲什麼我需要一個「$ user.invoke('ou','LDAP:// CN = Art Deco,OU = Sales,OU = Employees,DC = mycompany,DC = local','sAMAccountName = xxxx')」解決方案! – 2012-03-08 07:50:06