SCCM 2012: How to Customize Computer Name, Domain Joining and Moving to Right OU During OSD
There are numerous articles published for Customizing Computer Name, Domain Joining and Moving to Right OU during OSD. However, they imply an idealistic environment. But all environments are not Ideal and they have their own challenges. Below were the challenges in a client environment and they needed SCCM 2012 to work flawlessly to fulfill their needs.
- They do not want to Integrate MDT due to some internal political reason
- They don't want their computer name to include Serial No or Asset Tag. They want users Unique User ID to be in computer name
- Computer name should indicate Location, Device Type (Laptop or Desktop)
- Depending on Device Type (Laptop or Desktop) system should be moved to right OU
- Depending on computer name system should be joined to right Domain
- They wanted to keep it simple and technician friendly
- And above all it should be in a single task sequence
Here is what we ended up with to fulfill all above needs:
- Task sequence
- Use VBscript for technician to prompt for Location and User ID. Technician enters location (3 letters based on defined by organization), determine if it is Laptop or Desktop from BIOS and record as CL or CD. Technician enters UserID.
Eg ABCCL-USERID for Laptop and ABCCD-USERID
Variables are set and it will be used while assigning OSDComputername during Task sequence
Note : Use the script Before Running Apply Operating System Step!
|
Setup Domain Variable Logic: Script It checks if computer name starts with ABC then it will have to be added to XYZ.local domain and if it starts with DEF it will add to UVY.local domain. You can add as many as locations and domains in the script. Make sure you are ending the If statement and after you create one:
eg ** If** threeChars = "LMN" Then
sBuiltDomain = "QRS.local"
** End If**
|
Add the Script after Apply Windows Settings step:
Setup OU Variable logic : Script checks if Computer name if it has CL(Laptop) or CD(Desktop) and moved it to correct OU. You can add as many as locations and domains in the script. Make sure you are ending the If statement and after you create one:
|
Apply Network Settings: make sure you use correct account to run this step and it should have access in AD to join system and move it to correct OU.
Credits
Thanks to Romano Jerez for the MoveOU script where the logic is taken from and which is modified according to my requirement: