MoveComputerToOU Error

Feb 2, 2011 at 6:31 AM

I am attempting to use the MoveComputerToOU script with Maik's webservice.  I have included the scripts in my Deploy\Scripts folder and made the recommended modifications to my CS.Ini (see below).  I can't seem to get this working correctly, the Task Sequence ends up failing with this error:

Move Computer: Move was not successful

ZTI ERROR - Non-zero return code by Z_MoveComputer_StagingOU, rc =1

Litetouch deployment failed, Return Code = -2147467259  0x80004005

 

In the Webservice logs I see the error  ....WebService.AD|Error resolving computer and/or OU. Skipping further processing.

It seems to be an issue with the OU, not the computername.

Here is my CustomSettings.ini:

[Settings]
Priority=Default
Properties=StagingOU,OUPath

[Default]

MachineObjectOU=LDAP://OU=Computers,OU=Location,DC=domain,DC=com
StagingOU=LDAP://OU=Computers-Staging-MDTOnly,DC=domainDC=com

[MoveComputerToOU]
WebService=http://mdtserver/webservice/ad.asmx/MoveComputerToOU
Parameters=OSDComputerName,OUPath
OSDComputerName=ComputerName
MachineObjectOU=OUPath

Any assistance would be GREATLY appreciated.

Thanks

Richie Tenhet

Coordinator
Feb 4, 2011 at 7:29 AM

Hi Richie,

would it be possible to have a look on the z_moveComputer_StagingOU.log and the coresponding portion of the web service log? If not, check the values that get transfered. Is it still the correct path? in the web service log, does the function trying to evaluate the right path?

Regards

Maik

Feb 6, 2011 at 6:08 AM

Maik-

Here is the  z_moveComputer_StagingOU.log:

<![LOG[Microsoft Deployment Toolkit version: 5.1.1642.01]LOG]!><time="23:15:10.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[The task sequencer log is located at C:\Users\ADMINI~1\AppData\Local\Temp\SMSTSLog\SMSTS.LOG.  For task sequence failures, please consult this log.]LOG]!><time="23:15:10.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[Move Computer: Start processing Move computer to Staging OU routine]LOG]!><time="23:15:10.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[Move Computer: Swapping StagingOU and MachineObjectOU properties values]LOG]!><time="23:15:10.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[Property MachineObjectOU is now = LDAP://OU=Computers-Staging-MDTOnly,DC=domain,DC=com]LOG]!><time="23:15:10.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[Property StagingOU is now = OU=Computers,OU=Location,DC=domainDC=com]LOG]!><time="23:15:10.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[Using specified INI file = \\domain.com\mdtshare\DEPLOY\Control\CustomSettings.ini]LOG]!><time="23:15:10.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[CHECKING the [MoveComputerToOU] section]LOG]!><time="23:15:10.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[No valid specified for parameter 'OUPATH', web service results could be unpredictable.]LOG]!><time="23:15:10.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[About to execute web service call using method POST to http://mdtserver/webservice/ad.asmx/MoveComputerToOU: ComputerName=1606-6112-42&OUPath=]LOG]!><time="23:15:10.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[Response from web service: 200 OK]LOG]!><time="23:15:11.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[Successfully executed the web service.]LOG]!><time="23:15:11.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="1" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[Move Computer: Move was not successful]LOG]!><time="23:15:11.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="2" thread="" file="Z_MoveComputer_StagingOU">
<![LOG[ZTI ERROR - Non-zero return code by Z_MoveComputer_StagingOU, rc = 1]LOG]!><time="23:15:11.000+000" date="02-01-2011" component="Z_MoveComputer_StagingOU" context="" type="3" thread="" file="Z_MoveComputer_StagingOU">

And webservice log:

2011-02-02 00:14:35.3283|DEBUG|MaikKoster.Deployment.AD.Controller|Added LDAP:// to supplied Path "domain.com".
2011-02-02 00:14:35.3283|DEBUG|MaikKoster.Deployment.AD.Controller|Preparing AD Search.
2011-02-02 00:14:35.3283|DEBUG|MaikKoster.Deployment.AD.Controller|Search Root is "LDAP://domain.com".
2011-02-02 00:14:35.3283|DEBUG|MaikKoster.Deployment.AD.Controller|Executing query "(&(objectClass=computer)(|(cn=1606-6112-42)(distinguishedName=1606-6112-42)(sAMAccountName=1606-6112-42$)))".
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|No object found. Unable to get distinguished name.
2011-02-02 00:14:35.3439|INFO|MaikKoster.Deployment.WebService.AD|Getting OU from Active Directory
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|Get distinguished name for organizationalUnit "" on Server "
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|Get Directory Entry for ObjectDN "".
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|No ObjectDN supplied. Using Domain domain.com.
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|Getting Directory Entry for object domain.com using configured credentials for user DOMAIN\mdtuser.
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|Added LDAP:// to supplied Path "domain.com".
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|Preparing AD Search.
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|Search Root is "LDAP://domain.com".
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|Executing query "(&(objectClass=organizationalUnit)(distinguishedName=))".
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|Exception: The (&(objectClass=organizationalUnit)(distinguishedName=)) search filter is invalid. .
2011-02-02 00:14:35.3439|DEBUG|MaikKoster.Deployment.AD.Controller|No object found. Unable to get distinguished name.
2011-02-02 00:14:35.3439|WARN|MaikKoster.Deployment.WebService.AD|Error resolving computer and/or OU. Skipping further processing
2011-02-02 00:14:35.3439|INFO|MaikKoster.Deployment.WebService.AD|Unable to move computer 1606-6112-42 to new OU . Returning "False"

Thanks.

Coordinator
Feb 6, 2011 at 11:40 AM

Sry, have been blind. Your cs.ini need some small modifications.

1. Remove the OUPath from the Properties list. OUPath is the name of the parameter expected by the web service function, so we don't need to tell MDT that it shall treat it as a propety

2. In the MoveComputerToOU Section update the following lines:

Parameters=OSDComputerName,MachineObjectOU
OSDComputerName=ComputerName
MachineObjectOU=OUPath

The MDT syntax is a bit Yoda style. In the parameters line, we tell it what MDT properties it shall use for the call. If the MDT Property does not match the name of the web service parameter, we have to tell MDT how to map its properties to the corresponding Parameters. That's what the two lines below does.

In your case you defined OUPath as a mdt property and specified this one also on the parameters section, so MDT just used this (empty) property for the call.

Regards

Maik

Feb 8, 2011 at 2:22 AM

Maik-

Thanks so much for the assistance.  I am sure it's just my lack of knowledge, but I am still having issues after making the recommended mods to my CS.INI.  Now the TS is failing to actually join the computer to the domain (ZTIDomainJoin has attempted to join domain too many times).  The OU now values appear to be correct in the logs, but the Z_Move...OU.log just returns a "move not successful" and the webservice log still returns the "Error resolving computer and/or OU" error, but doesnt return "no object found" as it did previously.  Taking a look @ the ZTIDomainJoin.log I see something about "account *may* already exist in a different OU" but I have verified that this computer account does not exist in the domain.  

Any additional suggestions?

Thanks again.
Richie 

Feb 19, 2011 at 5:30 AM

Maik-

Any additional input that you can provide?

Thanks

Coordinator
Feb 19, 2011 at 10:21 AM

Would be gret to see the cs.ini and the log files (including setupact.log). Can you send them offline or send me a link where to find them?

Regards

Maik

Oct 28, 2011 at 3:18 PM

I have the same exact problem. The web service and Z_MoveComputer_StagingOU.wsf script works perfectly IF and only IF the computer account is already in AD (say it's a rebuild) If it's a new fresh build and the computer account isn't in AD then this script dies, recover from domain dies and the Z_MoveComputer_TargetOU.wsf dies. Does anyone know of a fix for this?