MoveComputerToOU help..

Sep 29, 2010 at 5:52 PM
Edited Sep 29, 2010 at 6:20 PM

This may be a bit of a dump Q but i cannot figure it out.

SCCM integrated with MDT 2010. Using the PrettyGoodFrontEndClone . All working as it should.

Trying the get the PCs into the correct OU.

Following this guide..

http://myitforum.com/cs2/blogs/maikkoster/archive/2010/04/08/moving-computers-in-active-directory-during-mdt-deployments-step-by-step.aspx

How do i dynamically set the MachineObjectOU , one being for laptops and one being for desktops?

I can set the MachineObjectOU to a specified OU, but it may only be true for laptops or desktops, or some other group.

Can someone give me an example in their CS.ini of what it should look like, or how to call this and set in MDT via the webservice?

Thanks.

 

Sep 30, 2010 at 10:01 AM

Your cs.ini could look like the following:

[Settings]
Priority=Initialization,SetOULaptop,Default
Properties=StagingOU

[Initialization]
StagingOU=OU=Staging,DC=HumptyDumpty,DC=com

[Default]
MachineObjectOU=OU=Desktops,DC=HumptyDumpty,DC=com

[SetLaptopOU]
Subsection=SetLaptopOU-%IsLaptop%

[SetLaptopOU-True]
MachineObjectOU=OU=Laptops,DC=HumptyDumpty,DC=com

 

It will initialize the "StagingOU" value with your staging OU (if you use any). It would configure the Laptops OU if the current computer is a laptop and would default back to the Desktops OU. For sure there are a lot other possible solutions as well. All depends on what exactly you need. You could also use Locations if it is location dependent, or MakeModel if it is a bit more complex then just Laptop/Desktop. Sometimes it can make sense to write your own script that does the actual evaluation.

Regards

Maik

Oct 27, 2010 at 5:10 PM

Hi Maik,

I'm actually having some troubles with this now as well.  I have my regular CS.ini file and everything is working well.  In it, I'm setting up a "TargetOU" custom property which builds out my LDAP:// string based on System Type, Site Code and Region (also pulled from the CS.ini file).  When attempting to execute the MoveComputer_TargetOU.wsf, I'm noticing in the logs that it shows MACHINEOBJECTOU is empty.

My CS.ini for executing the computer move looks like this:

[Settings]
Priority= Default,MoveComputerToOU
Properties=MyCustomProperty

[Default]
MachineObjectOU=%TargetOU%


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

Oct 27, 2010 at 5:11 PM

Oh yeah, my question...

Does MachineObjectOU not support referencing TS Variables to get a value?

Oct 27, 2010 at 6:49 PM

Got it figured out.  Had to set the MachineObjectOU in the CS.INI file that ZTIGather processes (linking to a variable doesn't work).

Nov 3, 2010 at 5:58 PM

You can reference TSvariables in the INI, but it is backwards to the way you think it ougt to be -or at least it seems backwards to me...

it is done TSVariable=Webservice Field name

So say I have a TSvariable I've defined myself called FinalOU.  This is the OU that I want the machine to be moved to.  I have set this variable using a VBScript oEnvironment.Item("FinalOU") = "OU=someOU,DC=blah,DC=blah,DC=com" or it could be set on a collection or it could be defined in a TS step - whatever you want.  The point is, I have a TS called FinalOU.

Then my section of the INI looks like this...  Note that in the Parameters I have the TSVariables listed - not the field names the web service wants.  The field name is set in the part where you put in TSVariable=FieldName.  Hopefully this makes sense.

[Settings]
Priority=Default
Properties=AssignedSite, UserID, UserPassword, UserDomain, MDTID,Type, MacAddress, FinalOU

[MovetoFinalOU]
WebService=http://mdtwebservicehost/MDTWebService/AD.asmx/MoveComputerToOU
Parameters=ComputerName,FinalOU
ComputerName=ComputerName
FinalOU=OUPath

Nov 19, 2010 at 11:17 AM

Great that you figured it out finally. And yes the webservice (and database) calls in MDT seem a bit akward sometimes. Little bit like "Yoda" style ;-)