MoveComputerToOU

Mar 24, 2010 at 11:33 AM
Edited Feb 7, 2011 at 10:46 AM

I have an issue with computers  not moving into the OU defined in the MDT database if the client is already in the AD. So I wanted to make sure that the client is moved into the correct OU as soon as posible in the BUILD/REBUILD task sequence. I dont have issues with the group policy interfering with the task sequence so I was hoping to just run the Z-MoveComputer_HostOS.wsf script in the task seqeunce. My CS.ini looks like this.

 

 [MoveComputerToOU]

WebService=http://server/DeploymentWebServices/ad.asmx/MoveComputerToOU

Parameters=ComputerName,MachineObjectOU

 

 I get the following error:

 The task sequence execution engine failed executing the action (Change OU) in the group (Install) with the error code 2147942487 Action output: Microsoft Corporation. All rights reserved. Microsoft Deployment Toolkit version: 5.0.1641.0 The task sequencer log is located at X:\WINDOWS\TEMP\SMSTSLog\SMSTS.LOG. For task sequence failures, please consult this log. MOVE COMPUTER: Processing Move computer to HostOS routine CHECKING the [MoveComputerToOU] section No parameters to include in the web service call were specified Property UserDomain is now = DOMAIN Property UserID is now = SMSClient <Message containing password has been suppressed> About to execute web service call using method POST to : ZTI ERROR - Unhandled error returned by Z-MoveComputer_HostOS: The parameter is incorrect. (-2147024809 0x80070057) Command line returned 2147942487 Entering ReleaseSource() for C:\_SMSTaskSequence\Packages\LIV000E0 reference count 1 for the source C:\_SMSTaskSequence\Packages\LIV000E0 before releasing Delete source directory C:\_SMSTaskSequence\Packages\LIV000E0 Released the resolved source C:\_SMSTaskSequence\Packages\LIV000E0. The operating system reported error 2147942487: The parameter is incorrect.

 

Not sure what the problem is any ideas welcome. Louis Dawson LJMU

Coordinator
Mar 25, 2010 at 10:21 AM

Please have a look to the Z-MoveComputer_HostOS.wsf script and add the line

oService.IniFile = "CustomSettings.ini"

just before the line with the sectionname, so that it looks like

 ' Create the web service instance
 Set oService = new WebService

 oService.IniFile = "CustomSettings.ini"
 oService.SectionName = "MoveComputerToOU"

 ' Make the web service call
 Set oXML = oService.Query

Additionally make sure ComputerName and MachineObjectOU are configured. I will update the scripts over the weekend to reflect this changes.

Maik

 

Mar 25, 2010 at 10:39 AM

Thanks Maik

Yes I already figured this out, but I have had an issue with the location of the CustomSettings.ini. I get the error:

"The file CustomSettings.ini could not be found in any standard locations"

It would seem that the CS.ini file needs to be present when you run the script, I have put it in the scripts directory in MDT tookit package and it now works.

I was expecting the values to be available when the gather phase was run, but they were not.

Not sure if this is expected or not, but I have managed to get it working.

Louis

 

Coordinator
Mar 25, 2010 at 11:15 AM

Are you using SCCM with MDT integration or plain MDT?

Regarding the gather, check the ztigather.log (or bdd.log) if they get set.

Mar 25, 2010 at 11:45 AM

Maik

I’m using MDT with SCCM 2007 R2.

As you can see from the logs it works OK but this is with the CS.ini in the scripts dir in MDT Toolkit package. I think if you define oService.IniFile = "CustomSettings.ini" in Z-MoveComputer_HostOS.wsf file, the default path is "%deployroot%\scripts

Therefore cannot find the CS.ini in the settings package.

Louis

---------------SCCM Task Sequence Log with NO CS.ini in the MDT Toolkit package

The task sequence execution engine failed executing the action (Change OU) in the group (Initialization) with the error code 2147942487

Action output: or task sequence failures, please consult this log.

MOVE COMPUTER: Processing Move computer to HostOS routine

FindFile: The file CustomSettings.ini could not be found in any standard locations.

Unable to find CustomSettings.ini, rc = 1

CHECKING the [MoveComputerToOU] section

No parameters to include in the web service call were specified

Process completed with exit code 2147942487

Property UserDomain is now = USERS

Property UserID is now = SRV_SMS2Client

<Message containing password has been suppressed>

About to execute web service call using method POST to :

ZTI ERROR - Unhandled error returned by Z-MoveComputer_HostOS: The parameter is incorrect.

 (-2147024809  0x80070057)

Command line returned 2147942487

Entering ReleaseSource() for C:\_SMSTaskSequence\Packages\LIV000E0

reference count 1 for the source C:\_SMSTaskSequence\Packages\LIV000E0 before releasing

Delete source directory C:\_SMSTaskSequence\Packages\LIV000E0

Released the resolved source C:\_SMSTaskSequence\Packages\LIV000E0. The operating system reported error 2147942487: The parameter is incorrect.

----------End Log

----------ZTIGather Log with CS.ini in the MDT package ---------

------ Processing the [MOVECOMPUTERTOOU] section ------       ZTIGather            25/03/2010 08:55:30        0 (0x0000)

Determining the INI file to use. ZTIGather            25/03/2010 08:55:30        0 (0x0000)

Using COMMAND LINE ARG: Ini file = CustomSettings.ini              ZTIGather            25/03/2010 08:55:30        0 (0x0000)

Finished determining the INI file to use.                ZTIGather            25/03/2010 08:55:30        0 (0x0000)

Using COMMAND LINE ARG: Ini file = CustomSettings.ini              ZTIGather            25/03/2010 08:55:30        0 (0x0000)

CHECKING the [MOVECOMPUTERTOOU] section              ZTIGather            25/03/2010 08:55:30        0 (0x0000)

Property UserDomain is now = USERS    ZTIGather            25/03/2010 08:55:30        0 (0x0000)

Property UserID is now = SRV_SMS2Client           ZTIGather            25/03/2010 08:55:30        0 (0x0000)

<Message containing password has been suppressed> ZTIGather            25/03/2010 08:55:30        0 (0x0000)

About to execute web service call using method POST to http://sccmadm2/DeploymentWebServices/ad.asmx/MoveComputerToOU: ComputerName=JM45441&OUPath=OU=Private Client V11,OU=Windows XP,OU=Clients,OU=Computers,OU=Resources,DC=jmu,DC=ac,DC=uk   ZTIGather            25/03/2010 08:55:30        0 (0x0000)

Response from web service: 200 OK       ZTIGather            25/03/2010 08:55:34        0 (0x0000)

Successfully executed the web service. ZTIGather            25/03/2010 08:55:34        0 (0x0000)

------ Done processing CustomSettings.ini ------ ZTIGather            25/03/2010 08:55:34        0 (0x0000)

From: MaikKoster [mailto:notifications@codeplex.com]
Sent: 25 March 2010 11:15
To: Dawson, Louis
Subject: Re: MoveComputerToOU [mdtwebfrontend:207126]

From: MaikKoster

Are you using SCCM with MDT integration or plain MDT?

Regarding the gather, check the ztigather.log (or bdd.log) if they get set.

Read the full discussion online.

To add a post to this discussion, reply to this email (mdtwebfrontend@discussions.codeplex.com)

To start a new discussion for this project, email mdtwebfrontend@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Coordinator
Mar 25, 2010 at 12:06 PM

Add the settings package as package to this step in SCCM. This way the cs.ini is available for the script.

Mar 25, 2010 at 12:17 PM

Maik

Yes I thought this may be the case, I will try it. I thought that the TS step package had to be the MDT toolkit package because the script resides in the MDT package, is this not the case?

Louis

From: MaikKoster [mailto:notifications@codeplex.com]
Sent: 25 March 2010 12:06
To: Dawson, Louis
Subject: Re: MoveComputerToOU [mdtwebfrontend:207126]

From: MaikKoster

Add the settings package as package to this step in SCCM. This way the cs.ini is available for the script.

Read the full discussion online.

To add a post to this discussion, reply to this email (mdtwebfrontend@discussions.codeplex.com)

To start a new discussion for this project, email mdtwebfrontend@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Coordinator
Mar 25, 2010 at 1:04 PM

It's not required if you call the script with e.g.

cscript.exe "%ScriptRoot%\Z-MoveComputer_HostOS.wsf"

The step "Use Toolkit package" will make sure that the scripts are available locally and %ScriptRoot% is pointing to the right target. This gives you the possibility to have the Settings package as package for this particular step. This way you are even able to use different settings packages.