7 Replies Latest reply on Nov 30, 2017 2:53 AM by leekem

    Choose OU for computer object




      Hope someone will be able to help.


      I'm creating a Windows 10 imaging routine and would like to be able to choose an OU in which the AD computer object of the machine being imaged would be created. So, the engineer building a machine has the option to place the computer in an OU that's relevant to the hardware type (desktop/laptop) and the machine's function in the business (Finance, Marketing etc).


      Are there any menu-driven/choice options out there where the user can select the OU in which the computer object will be created? If that solution also takes into account that a (Windows 7) computer with the same name may already exist in AD - so much the better.


      Thanks in advance,



        • 1. Re: Choose OU for computer object
          davidg5700 Specialist

          I would love to have this available as well.  It doesn't seem like it would take much for them to roll this up as an option. 


          Since we don't just dump all of our computers into one OU, I have to maintain a dozen different templates that point to different OU's.  Ivanti keeps pumping the idea of one or two templates to image all of your machines.  Having an "OU chooser" would get me down to just a single template.


          I asked about this at a provisioning session at Interchange and the product manager asked for a show of hands and then stated that it probably won't happen.  There is an enhancement request out there for this, please vote it up.  If you know any way to ramp up the pressure for this, that would be great.

          • 2. Re: Choose OU for computer object
            steve.may Apprentice

            Do you have data analytics?  We use a web form that allows an attribute to be changed in inventory.  Our Join Domain action runs a PowerShell script that uses that inventory value to specify the OU that the computer account is placed into during provisioning.  We have five different domains here that include a total of about 20 OUs.  We only have to have to maintain one single Join Domain script.  Not sure if you have any scripting experience, but there's a few different ways you could handle it.

            • 3. Re: Choose OU for computer object

              Thanks for the replies.


              I'm not averse to writing some PowerShell with a WinForm that would give the engineer a dropdown list of OUs where the computer object would be placed, but I just assumed that this functionality might be native in the LANDesk OSD component.


              davidg5700 - I'll share the script when done in case it's of any use to you.





              • 4. Re: Choose OU for computer object
                davidg5700 Specialist



                That would be of great use for me.  It would be greatly appreciated! 


                I agree, this really should be a built in capability.  It seems to me so basic and universal.


                Thanks in advance for your efforts.

                • 5. Re: Choose OU for computer object
                  BrandonLH25 Rookie

                  You could try an OU Name Location action with a variable of something like %ldHostname%.


                  And then after that, have a Join Domain action window pop-up and then specify your specific OU you want the machine to go in.


                  As long as the service account works to be able to join machines to the domain, it should work.  It the AD object is already in the OU that will be specified, it works as well.

                  • 6. Re: Choose OU for computer object
                    1EarEngineer Specialist

                    Are you running 2016 or higher by chance?

                    I haven't tested this, but you might be able to use IF statements that pull the subnet and then use a domain join that's preconfigured to that appropriate OU.


                    Another thing we do here is create the AD account first, then image and leave the OU portion out of the domain join action.

                    • 7. Re: Choose OU for computer object



                      Apologies for the delay around this. The project which necessitated the work had been somewhat delayed.


                      I've created a PowerShell form which prompts for a computer name, OU to put the machine in and a computer description. Our naming convention uses the computer serial number, so the form auto-populates with a default name. A corresponding OU is also auto-selected in our case.


                      To use it, download the files from https://www.dropbox.com/sh/30e6ohf73u680w7/AACdTb5mmpcvYfbfumU9HLdQa?dl=0 and place them in the same folder. If you run the PowerShell as part of the build sequence and click "OK", the values are outputted to out.csv. That CSV can then be referenced later in the build sequence with the values being used by netdom.exe, Add-Computer etc.


                      Hope that helps someone.