Skip to content

Configure User/Device Affinity During Image Deployment

Featured Replies

I am doing some recon on the possibility of determining user/device affinity during image deployment via a task sequence.

 

I would like to know if it is even possible to establish affinity during the imaging process? This could be automatic or manual (through the use of input field prompts during the TS). Provided this is possible, this could simplify the installation of existing applications that are already installed based on user enrollment in certain security groups. It will also eliminate the need to create additional packages and task sequences since applications do not run (at least I haven't figured out how to do this) during a task sequence.

 

We are running a single SCCM 2012 primary site with WSUS and SCOM. Nothing else is configured/needed at the moment.

 

Basically, I want to do the following:

 

  1. Start TS deployment
  2. Input/establish user affinity
  3. Finish image deployment (base image, user profile, etc.)
  4. Finished machine is added to correct user group based on affinity set in step 2 above.
  5. Required software for user group is installed.
  6. Machine deployed to user.
  7. Voila'...finshed.

It seems simple enough, but with the many "features" Microsoft has included with their products, I have my reservations.

 

I don't want to spin my wheels trying to figure this out on my own, so I thought I would ask here first to see if this is even feasible.

 

Thanks in advance,

Mike

  • Replies 29
  • Views 27.7k
  • Created
  • Last Reply

Top Posters In This Topic

Posted Images

  • Author

Your link looks very promising. Would I need to import affinity associations prior to trying something like this or can i stick with entering a user affinity upon execution of the image TS? I have already added the SMSTSUdaUsers variable to my boot image and am currently testing it out. It prompted me for a primary user so i am crossing my fingers.

 

Being a little slow, could you explain the $ResourceName and $Container variable for your script a little more.

 

I am going to assume that the "Get Applications" TS step shown in the illustration is where the powershell script is configured.

 

Great info...Thanks again for the ideas.

It doesn't matter how you input the user, as long as you do :)

 

The resourcename variable is the name of the computer object running the task sequence and the container variable is the folder name that contains your application deployment collections (just to prevent the script from searching through all collections).

  • Author

Got it. Since I plan on implementing this script for all devices, can I use %_SMSTSMachineName% as the ResourceName?

  • Author

hmmm, something went wrong. I am going to chalk the failure up to not knowing anything about powershell and how to use scripts in a TS. I am hoping that I can figure this out. Again, any advice i can get is greatly appreciated.

 

I am running SCCM 2012 on a 2008 R2 server with a local instance of SQL 2012.

 

When the OSD TS loads via boot media, I am prompted to enter in a primary user for the machine being loaded. This is accomplished using the SMSTSUdaUsers variable that I have pre-defined in the boot image. This part works.

 

The deployment works fine until the powershell script executes. I followed the instructions (I think) correctly. I created a package for the script with no program. It has been distributed correctly to my distribution points. I have created a separate folder called "Software Applications" within the Applications node and populated it with my Firefox application (see app_container attachment). I have tested the application to ensure that it works correctly.

 

Script Parameters:

param (
[%_SMSTSMachineName%]$ResourceName,
[DOR]$SiteCode,
[sCCM2012DOR.fqdn]$SiteServer, (is the fqdn required here?)
[software Applications]$Container
)
TS Steps: (see attached files, get_apps executes powershell, install_apps installs them)
Every thing executes fine up to the powershell step. Then the system hangs for a few seconds and reboots. The user affinity is set correctly, but firefox is not installed. Once rebooted and the config manager starts communicating, firefox is loaded based on the user group setting assigned to the primary user.
I do not have any logs at the moment as I am running another test, but I think my setup is causing the issues at hand.
What am I doing wrong here? I have a gut feeling it is something very simple.
Thanks again,
Mike

post-6493-0-29073400-1400764009_thumb.jpg

post-6493-0-34771200-1400764019_thumb.jpg

post-6493-0-30172300-1400764039_thumb.jpg

  • Author

Does anyone have some sort of tutorial on how to do this? I have not figured out why I cannot get this to work. After 2 weeks of futility, I am ready to give up on this.

Sorry, I completely missed your reply.

 

You're getting close. Your task sequence setup looks correct, but the folder part is wrong. The container that should be added as input should be a container holding your application collections. Based on that container the search for collection memberships of the user will be narowed from the start.

  • Author

I have created a folder in User Collections called Applications. This sub-folder will contain all of the user collections for applications.

 

For the container variable in the script, I used Applications as the variable. Is this sufficient, or do I need to define a specific path that directs the script to this container?

 

It appears that there is more to this. The TS just failed with the error code 0x00000001. I am trying to find the logs now to see what went wrong.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.