Script to name computer with user input and add to AD
Posted on 2012-12-20
I have a zinger that will really show your skills!
I've found a lot of scripts online that can be used during a Bare Metal OS Deployment Task Sequence in SCCM that will prompt the user for the Computer Name. I'm looking for something a little more robust.
Our Naming Convention for computers is <Location><Org><xWKx><4 numbers>
So for one Org (we'll call it Sales) that has 3 Workstations, they would be named:
> LOC is always the same.
> Org depends on the organization the machine belongs to.
> XWKX is always the same
> The 4 numbers are just the next available (Not already used) in Active Directory.
With me so far? Ok, here's what I'm looking for:
I want a script to add to the Task sequence that will prompt the user for their Org only.
Then I want it to create the computer name by adding <LOC><User input for Org><xWKx><next available number in AD>
Oh, and once it has a name, can it add the computer to Active Directory? (Ideally for this part, the OU it would be created in would also be dependant on the Org, but we can have an Imaging OU and just put them all in there to move them later)
Anything close to this would be a huge deal!
Thank you and I hope to see some ideas soon!