WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: Orionbelt on February 17, 2015, 03:17:58 PM

Title: Move Computer Object to different OU.
Post by: Orionbelt on February 17, 2015, 03:17:58 PM
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
Title: Re: Move Computer Object to different OU.
Post by: td on February 18, 2015, 07:59:39 AM
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.
Title: Re: Move Computer Object to different OU.
Post by: Orionbelt on February 18, 2015, 08:20:32 AM
Thanks again TD
   You are right, i revisited the path for LDAP and now it is working fine...thanks again.