I’m using the Boot Image to set User Device Affinity (UDA) to devices managed by SCCM 2012 R2 SP1.
First, here’s how we script looks to:
Dim userDA, smsUserMode Set env = CreateObject("Microsoft.SMS.TSEnvironment") ' We enable UDA variable here - before assigning user smsUserMode = "Auto" env("SMSTSAssignUsersMode") = smsUserMode userDA = Inputbox("Type a valid Active Directory user account." & vbCrLf & vbCrLf & _ "Format: DOMAIN\Username", "Name of primary user for device...") env("SMSTSUdaUsers") = userDA ' writing to log wscript.echo "User device affinity set to " & env("SMSTSUdaUsers") wscript.echo "We're going to set UDA by setting SMSTSAssignUsersMode variable to: " & env("SMSTSAssignUsersMode")
I’m going to save this script on a shared network location. This code is widely used by many people, and I’m not the creator of it; I’ve just slightly modified it.
Next, I’m going to customize the Boot Image file in SCCM, see screenshot.