Joining to Domain - Location Computer OUs
I was wondering if it’s possible to join a computer to a domain and put it in a specific OU depending on the location?
So, for example, when I image a system and I perform a full host regsitry & inventory and I set it to a location (say UK), is it then possible to link that to an OU? - i.e. Domain - CompanyName - Location (UK in this instance) - Computers.
Or is it simply a case of having to go into the web gui and remembering to set the OU before it joins the domain?
@george1421 I’ve also used a custom vb program and the unattend.xml first run feature to auto login to the workstation right after imaging and then run the vbscript to move the target computer from a build up OU to the proper OU. Then reboot. I have the fog postinstall script update a parameter that is passed to the vbscript during imaging. While I didn’t write this script http://blog.coretech.dk/jgs/vbscript-move-computer-object-to-another-ou-via-command-line-parameter/ it is crazy similar to the one I wrote. It would have been nice If I found this one first to save me some grief.
The only caveat here is that this script must be run as a user that has domain move computer rights.
@RobTitian16 The next time you build a reference image I suggest that you use a generic unattend.xml file even if you have FOG do everything. It make it easier to extend the capabilities of FOG if the unattend.xml file is referenced during Windows OOBE.
@george1421 Thanks George - I thought that would be the case. I’ll see if I can cook something up in the post installation script and test it out later when I have some more time
If you are using the unattended.xml file then you can dynamically have a FOG post install script update the unattend.xml file with the proper OU. This is instead of having the FOG Client connect the device to AD. If your FOG post install scripts are location aware (such as based on an IP address range) and that range can be associated with an OU then your OU structure can be calculated. I use something similar for my company. I also take it one step more, I determine if the device is a desktop, laptop, or tablet and factor that into the device OU assignment. Update the unattend.xml file and let it connect the device to AD.
You could also use the (unsupported) persistent groups in FOG 1.3.0 to set an OU based on group membership. In this case you would create a template host with the proper AD assignment and the during registration (I think) assign the host to that group. The template host values will be applied to the new host during registration.