Can you Identity users primary device assgined by the user agent via Powershell?


I've been using the Get-CMUserDeviceAffinity to find a users primary device, however i'm experiancing problems when a user has more than 1 primary device (I have 2, my laptop and an RDS server). Is there a way to query a users primary device filtered on the User Affinity type? i.e. User Agent assigned?


January 23rd, 2014 8:09am

Yes, use a filter for "Sources".

Get-CMUserDeviceAffinity -UserName "Domain\Username" | where Sources -eq "2"
Note that I have not verified what "2" nor "User Agent Assigned" is so the line above might not be accurate for that, you'll have to get the correct value to filter on.
Free Windows Admin Tool Kit Click here and download it now
January 23rd, 2014 8:57am


Here is an official article for your reference.


January 24th, 2014 6:42am

it looks like you want Source "4", per the dbo.UserMachineSources table:

SourceID            Name

1            Software Catalog

2            Administrator

3            User

4            Usage Agent

5            Device Management

6            OSD

7            Fast Install

8            Exchange Server connector

Mike Crowley | MVP
My Blog -- Baseline Technologies

Free Windows Admin Tool Kit Click here and download it now
March 24th, 2015 3:19pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics