SCCM 2012 Assigning OU's without multiple Task Sequences

I am trying to find a way to script the assigning of OU's in my task sequence so I don't have to have a TS for each OU.

I need this to work for existing computers on my domain and newly imported.

I work for a large schools system and each classroom/lab has it's own OU.

I have a standard naming convention for the computers of BuildingName-Room#

Do I have to use MDT? If so, how and where in the task sequence do I perform this task?
Who is Participating?
Nagendra Pratap SinghConnect With a Mentor Commented:
Does this work for you?

Basically you need to set OSDDomainOUName  using some method.

or you can pre-create the accounts in AD in the specified OU
kisdAuthor Commented:
It is the "some method" that I am looking for help with.
Mike TConnect With a Mentor Leading EngineerCommented:

"Some method" :)

One solution is to create collections or use existing ones, and set the OSDDomainOUName per collection. e.g.

Collection             OU
Building 1            Chemistry lab
Building 2            Biology lab

An alternative I just thought of is to set the variable as a TS step, but use the conditions tab to set WMI filters (see Hayes Jupe's link below). It's slightly more complicated but avoids the overhead of collections and is more user-friendly further down the line.

Using TS variables
Prompting for computer name

The latter could easily prompt for building name instead, or just hardcode it per collection.

Hope that helps,

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.