none
Automatic placement of computer in OU based on computer name prefix RRS feed

  • Question

  • Using MDT 2013 Update 1. 

    The computer name is created manually by technician and always starts with a city code such as MI, NY, CA etc... I want to be able to then place the computer object into the appropriate OU based on the 2 letter prefix of the computer name. 

    Please advise as to the simplest way of achieving this!

    Thank you!

    Wednesday, March 30, 2016 2:04 PM

All replies

  • You can either make the OU selectable in the wizard or you can use a gateway priority in custom settings to set the OU.

    In custom settings:

    MachineObjectOU=OU=MyOu,DC=MyDom,DC=MyCompany,DC=com 
    DomainOUs1=OU=MIOu,DC=MyDom,DC=MyCompany,DC=com 
    DomainOUs2=OU=NYOu,DC=MyDom,DC=MyCompany,DC=com 
    DomainOUs3=OU=CAOu,DC=MyDom,DC=MyCompany,DC=com 

    or

    [Settings]
    Priority=DefaultGateway, Default
    
    [DefaultGateway]
    10.1.1.1=MI
    12.2.1.1=NY
    20.1.1.1=CA
    
    [CA]
    MachineObjectOU=OU=CAOu,DC=MyDom,DC=MyCompany,DC=com 


    If this post is helpful please vote it as Helpful or click Mark for answer.

    Wednesday, March 30, 2016 4:29 PM
  • Hey Dan! Yes, I have implemented the above in my customsettings. I was looking for a more automated approach instead of the technician choosing an OU. What I have found is that the tech "forgets" to choose an OU and the object is then placed in the computers OU.. 

    Since the computer name will all have a 2 or 3 letter prefix I was hoping to then link the city prefix to our OU structure in AD...

    Wednesday, March 30, 2016 4:33 PM
  • Use the second approach for automation, that is the default gateway. Set the OU for each gateway.

    See this post, it will probably help you achieve what you want.
    http://deploymentbunny.com/2012/04/21/back-to-basic-customsettings-ini-explained/


    If this post is helpful please vote it as Helpful or click Mark for answer.

    Wednesday, March 30, 2016 4:56 PM
  • Yes I was thinking of that as well. However, we image our laptops at our HQs and then ship the laptop to the destination. So the gateway will always be HQ even though the laptop belongs elsewhere. So the gateway option will not suffice. 

    I found this link. http://blog-en.netvnext.com/2012/02/osd-automate-domain-ou-name-from.html

    Unsure if it will work in MDT 2013 update 1 as a standalone without SCCM...

    Wednesday, March 30, 2016 4:59 PM
  • One thing you can do to automate the OU is having different Task Sequences. Since you know which machines are going where, you can select the "California" task sequence for example. In the task sequence itself you can set the OU.

    I do that for "offsite" machines also because we configure them a little differently.


    If this post is helpful please vote it as Helpful or click Mark for answer.


    • Edited by Dan_Vega Wednesday, March 30, 2016 6:16 PM
    Wednesday, March 30, 2016 6:14 PM
  • Yes, that would also be another option. In our environment, we have a golden image for all locations. The only difference is the OU placement. We have around 21 sites currently and growing and I don't want to have 21 TS showing up... I will continue to research on this topic...
    Friday, April 1, 2016 12:16 PM
  • You can use the MDT database to do this. Once you have configured the database you can add in a Location by Default Gateway. In the Details tab you have an option for MachineObjectOU. You can also option to name your computer. During you gather step MDT will pick up this information.

    I was able support 30 locations with this setup without having to worry about a tech putting the computer in the wrong OU or incorrect name.

    Saturday, April 2, 2016 5:55 AM
  • Thank you. Using the default gateway is not an option as stated before where we image computers at our HQ but its actually being shipped to our remote sites nation and worldwide. I may go with different task sequences for each site and indicating the rules in my customsettings.ini file as the way to go unless there is a more efficient way of achieving this.. Thank you all again for your time.
    Wednesday, April 6, 2016 11:37 AM