$target = Get-ADOrganizationalUnit -LDAPFilter "OU=Sales - Clothes,OU=Mall,OU=Computers,OU=Site2364"
get-adcomputer computername1 | Move-ADObject -TargetPath $target.DistinguishedName
我OU有(销售收入 - 衣服)的空间移动计算机使用PowerShell
出现的错误说
Move-ADObject : Cannot validate argument on parameter 'TargetPath'. The argument is null or empty. Provide
an argument that is not null or empty, and then try the command again.
At line:2 char:53
+ ... mputer PCJ21584 | Move-ADObject -TargetPath $target.DistinguishedName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Move-ADObject], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.ActiveDirectory.Management.Command
s.MoveADObject
我只是想通出。我需要使用-Identity而不是-LDAPFilter –