MoveComputerToOU - error

May 12, 2009 at 11:33 AM

I just installed the MDT webservice in my MDT 2010 Beta installation and I'm getting an error.

I've added the following to my CustomSettings.ini:

Properties=StagingOU

[Default]
StagingOU=OU=Staging,DC=invmgt,DC=wan

[MoveComputerToOU]
WebService=http://bdd/Deployment/ad.asmx/MoveComputerToOU
Parameters=ComputerName,MachineObjectOU

The error message:

MOVE COMPUTER: Processing Move computer to Staging OU routine Z-MoveComputer_StagingOU 2009-05-12 13:15:37 0 (0x0000)
MOVE COMPUTER: Swapping StagingOU and MachineObjectOU properties values Z-MoveComputer_StagingOU 2009-05-12 13:15:37 0 (0x0000)
Property MachineObjectOU is now = OU=Staging,DC=invmgt,DC=wan Z-MoveComputer_StagingOU 2009-05-12 13:15:37 0 (0x0000)
Property StagingOU is now = OU=Workstations,OU=Root,DC=invmgt,DC=wan Z-MoveComputer_StagingOU 2009-05-12 13:15:38 0 (0x0000)
Using DEFAULT VALUE: Ini file = \\BDD\Distribution$\Control\CustomSettings.ini Z-MoveComputer_StagingOU 2009-05-12 13:15:38 0 (0x0000)
CHECKING the [MoveComputerToOU] section Z-MoveComputer_StagingOU 2009-05-12 13:15:38 0 (0x0000)
About to execute web service call to http://bdd/Deployment/ad.asmx/MoveComputerToOU: ComputerName=st7176&MachineObjectOU=OU=Staging,DC=invmgt,DC=wan Z-MoveComputer_StagingOU 2009-05-12 13:15:38 0 (0x0000)
Unexpected response from web service: 500 Internal Server Error
Missing parameter: OUPath.
 Z-MoveComputer_StagingOU 2009-05-12 13:15:38 0 (0x0000)
Unable to call MoveComputerToOU web service. Z-MoveComputer_StagingOU 2009-05-12 13:15:38 0 (0x0000)
Z-MoveComputer_StagingOU processing completed successfully. Z-MoveComputer_StagingOU 2009-05-12 13:15:38 0 (0x0000)

Is this because I'm runing 2010 or have I made a mistake in my configuration?

May 13, 2009 at 8:23 AM

Followup.

I did the following. I changed CustimSettings.ini to:

[Settings]
Properties=StagingOU,OUPath

[Default]
StagingOU=OU=Staging,DC=invmgt,DC=wan

[MoveComputerToOU]
WebService=http://bdd/Deployment/ad.asmx/MoveComputerToOU
Parameters=ComputerName,OUPath

...and then I added the following line to Z-MoveComputer_StagingOU.wsf and Z-MoveComputer_HostOS.wsf:

oEnvironment.item("OUPath") = oEnvironment.item("MachineObjectOU")

After that the task sequence works without errors:

MOVE COMPUTER: Processing Move computer to Staging OU routine Z-MoveComputer_StagingOU 2009-05-13 08:59:49 0 (0x0000)
MOVE COMPUTER: Swapping StagingOU and MachineObjectOU properties values Z-MoveComputer_StagingOU 2009-05-13 08:59:49 0 (0x0000)
Property MachineObjectOU is now = OU=Staging,DC=invmgt,DC=wan Z-MoveComputer_StagingOU 2009-05-13 08:59:49 0 (0x0000)
Property StagingOU is now = OU=Workstations,OU=Root,DC=invmgt,DC=wan Z-MoveComputer_StagingOU 2009-05-13 08:59:49 0 (0x0000)
Property OUPath is now = OU=Staging,DC=invmgt,DC=wan Z-MoveComputer_StagingOU 2009-05-13 08:59:49 0 (0x0000)
Using DEFAULT VALUE: Ini file = \\BDD\Distribution$\Control\CustomSettings.ini Z-MoveComputer_StagingOU 2009-05-13 08:59:49 0 (0x0000)
CHECKING the [MoveComputerToOU] section Z-MoveComputer_StagingOU 2009-05-13 08:59:49 0 (0x0000)
About to execute web service call to http://bdd/Deployment/ad.asmx/MoveComputerToOU: ComputerName=st7176&OUPath=OU=Staging,DC=invmgt,DC=wan Z-MoveComputer_StagingOU 2009-05-13 08:59:49 0 (0x0000)
Response from web service: 200 OK Z-MoveComputer_StagingOU 2009-05-13 08:59:50 0 (0x0000)
Successfully executed the web service. Z-MoveComputer_StagingOU 2009-05-13 08:59:50 0 (0x0000)
Z-MoveComputer_StagingOU processing completed successfully. Z-MoveComputer_StagingOU 2009-05-13 08:59:50 0 (0x0000)

---

MOVE COMPUTER: Processing Move computer to HostOS routine Z-MoveComputer_HostOS 2009-05-13 10:06:04 0 (0x0000)
Property OUPath is now = OU=Workstations,OU=Root,DC=invmgt,DC=wan Z-MoveComputer_HostOS 2009-05-13 10:06:04 0 (0x0000)
Using DEFAULT VALUE: Ini file = \\BDD\Distribution$\Control\CustomSettings.ini Z-MoveComputer_HostOS 2009-05-13 10:06:04 0 (0x0000)
CHECKING the [MoveComputerToOU] section Z-MoveComputer_HostOS 2009-05-13 10:06:04 0 (0x0000)
About to execute web service call to http://bdd/Deployment/ad.asmx/MoveComputerToOU: ComputerName=st7176&OUPath=OU=Workstations,OU=Root,DC=invmgt,DC=wan Z-MoveComputer_HostOS 2009-05-13 10:06:04 0 (0x0000)
Response from web service: 200 OK Z-MoveComputer_HostOS 2009-05-13 10:06:04 0 (0x0000)
Successfully executed the web service. Z-MoveComputer_HostOS 2009-05-13 10:06:04 0 (0x0000)
Z-MoveComputer_HostOS processing completed successfully. Z-MoveComputer_HostOS 2009-05-13 10:06:04 0 (0x0000)

---

Thing is, although the web service reports a 200 OK it doesn't really do anything. The computer object never gets moved. Is there any way to log what the web service does and doesn't do?

Coordinator
May 17, 2009 at 8:26 AM

Hi flic,

the Webservice expects two parameters. "Computername" and "OUPath". If you are using a different Parametername within the MDT Scripts (Like "MachineObjectOU") you would need to map those Properties in the definition of the webservice call. So the section in the ini file should look like:

[MoveComputerToOU]
WebService=http://bdd/Deployment/ad.asmx/MoveComputerToOU
Parameters=ComputerName,OUPath
MachineObjectOU=OUPath

Adding this, MDT will use OUPath as parameter name and use the value of MachineObjectOU. I`ve just updated my Blog post about Moving computers to reflect this. As writing the article about moving computers it was mainly written for demonstration purposes. This thing has somehow grown really fast :-)

The 200OK response just means that the scripts was able to successfully call the webservice. The webservice itself will return a boolean value as response. With either True or False depending on the result of the Movement.

Currently I'm extending the complete webservice with quite extensive Tracing to enable easier troubleshooting on what might have happened. I will upload a new version of this webservice with a couple minor bugfixes and this new Tracing within the next couple of weeks. The "MoveComputerToOU" section is already finished. If you want just give me an email address and I will send you a pre-release of this.

 

Regards

Maik

May 20, 2009 at 6:47 AM

Thanks, Maik.

 

Just a quick question about the OUPath parameter and the .ini file. I don't really understand the logic. You send the ComputerName and OUPath parameters to the webservice, and then you set the MachineObjectOU parameter to the return value? Where do you set the OUPath parameter?

I took another look at the blogpost, but there you send MachineObjectOU as a parameter to the webservice instead:

    [MoveComputerToOU]
    WebService=http://MyWebServer/Deployment/ad.asmx/MoveComputerToOU
    Parameters=ComputerName,MachineObjectOU
    MachineObjectOU=OUPath

I'm sorry, I've probably missed something extremely obvious but I'd appreciate a nudge in the right direction.

Coordinator
May 20, 2009 at 7:25 AM

If the Parameter name of the webservice is identical to the Propertyname used within MDT we simply add the property as an Parameter. However in our case the webservice expects to see a Parameter called "OUPath" but the Property is named "MachineObjectOU". So we need to tell MDT that it shall use the value of the Property "MachineObjectOU" as the value for the webservice Parameter "OUPath". That`s what we do in the line "MachineObjectOU=OUPath". It is not setting MachineObjectOU to the value of OUPath, it`s rather telling the script logic to use MachineObjectOU as value for OUPath.

This concept has also never been really obvious to me, but if we want to use the MDT scripts, we have to tell them what to do in the way they expect it to get. ;-)