Ou 错误:使用“1”参数调用“MoveTo”时出现异常:“服务器不愿意处理该请求。”
我正试图写一个脚本来移动Ad2008中的用户数量Ou 错误:使用“1”参数调用“MoveTo”时出现异常:“服务器不愿意处理该请求。”,ou,Ou,我正试图写一个脚本来移动Ad2008中的用户数量 $Alias = "hareeshvm" # Finding the location of the user account harveesm: $Root = [ADSI]("LDAP://DC=corp,DC=bharatpetroleum,DC=com") $searcher = new-object System.DirectoryServices.DirectorySearcher($root) $searcher.filter
$Alias = "hareeshvm"
# Finding the location of the user account harveesm:
$Root = [ADSI]("LDAP://DC=corp,DC=bharatpetroleum,DC=com")
$searcher = new-object System.DirectoryServices.DirectorySearcher($root)
$searcher.filter = "(&(objectClass=user)(mailNickName= $Alias))"
$User = $searcher.findone()
# Binding the user account to $AUser and the OU to move to to $MovetoOU
$ADSPath = $User.Properties.adspath
$MoveToOU = [ADSI]("LDAP://OU=Temp,DC=corp,DC=bharatpetroleum,DC=com")
$AUser = [ADSI]("$ADSPath")
执行实际移动的命令
$AUser.PSBase.moveto$MoveToOU
我得到下面提到的错误
使用1个参数调用MoveTo时出现异常:服务器不愿意处理该请求。
位于D:\Ashish\MS Exchange\New User\newuserscreation.ps1:39 char:21
+$AUser.PSBase.moveto