Move Computer Object to different OU.

Started by Orionbelt, February 17, 2015, 03:17:58 PM

Previous topic - Next topic

Orionbelt

Hi,
  Just simple query to move computer to different OU from AD, but getting Object not found, even though object is there and i have full permssion.

strCred = dsSetCredent("MS\ADPERMISSION", "Password")

strGetCompOU = "ms123456"

sSourcePath  = dsfindpath("LDAP://ms.ny.com","CN=%strGetCompOU%")
stragetOU ="LDAP://ms.ny.com/CN=%strGetCompOU%,OU=NY2,OU=US,OU=WorkStations,DC=MS,DC=MILL,DC=com

MOVE    = dsMoveObj(sSourcePath ,sAdsiPath, "")

Or I tried with
MOVE     dsMoveObj(sSourcePath ,sAdsiPath, "CN=%strGetCompOU%")


getting error 1063 : OBJECT DOES NOT EXIST.

I am using 2014b winbatch

td

Take a look at the help file topic for the dsMoveObj function in the extender help file and carefully examine the examples.  The third parameter is only needed when renaming an object and should only consist of 'CN=whatever' and not the complete LDAP path.  If you are not renaming an object then it should be an empty string ("").

Other than that it is not possible to determine the cause of your problem because you have not provided the contents of the second parameter.  The second parameter should be the full LDAP path to the the new container but it should not include the CN of the object being moved.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Orionbelt

Thanks again TD
   You are right, i revisited the path for LDAP and now it is working fine...thanks again.