Target Computers by Users' usergroup membership

Problem:  The *they* in your organization (whether that is management, another team you don't have influence over, or just policies that are difficult to influence at this time), *they* want you to advertise software to users in a usergroup.  But you know that although SMS can target users and usergroups, software distribution history on the local client goes into a different area in WMI, and the right-click tools, SMSClient Center, and lots of other wonderful SMS utilities either don't interface with that user-specific WMI area at all, or are inconsistent, so you want to advertise to the Machines, not the users.

Solution:  From http://www.systemcentertools.com, grab Security Login Audit Tool (SLAT).  Follow the instructions for configuring SLAT (requires 3 basic things: you may need modify your GPO settings to record Security Audit information locally in the event log, modify your sms_def.mof (and compile it on the server and all clients), and schedule the SLAT scan to run on a recurring basis.  But once that is done, you can use the new tables/views created to get "computers where the highest ranked user is a member of usergroup <whatever>".  Example of a query-based collection below.  The example below also limits the results to machines that have reported a Hardware Inventory in the last 7 days.

select SMS_R_System.ResourceID,SMS_R_System.ResourceType,
  SMS_R_System.Name,SMS_R_System.SMSUniqueIdentifier,
  SMS_R_System.ResourceDomainORWorkgroup,SMS_R_System.Client
from
SMS_R_System inner join SMS_G_System_MCS_USERLOGONINFO_1_0
  on SMS_G_System_MCS_USERLOGONINFO_1_0.ResourceID = SMS_R_System.ResourceId
  inner join SMS_G_System_WORKSTATION_STATUS
  on SMS_G_System_WORKSTATION_STATUS.ResourceID = SMS_R_System.ResourceId
where
SMS_G_System_MCS_USERLOGONINFO_1_0.UserName in
(select UserName from  SMS_R_User where UserGroupName like "%TechnologyPilot%") and SMS_G_System_MCS_USERLOGONINFO_1_0.UserRank = 1 and
datediff(day,SMS_G_System_WORKSTATION_STATUS.LastHardwareScan,getdate()) <= "7"

You could of course do something similar without the user ranking add-on; but you will most likely get inconsistent results as the v_r_system.user_name0 can change or be blank.  If you are SP3, and have it enabled, you could replace the SLAT information and instead use the Console User information.

Published Wednesday, October 25, 2006 4:01 PM by skissinger
Filed under:

Comments

No Comments