Posts

Showing posts from July, 2018

Machine collection based on user AD group

In general I don't recommend anyone do this unless you have to. Especially in environments where a user has more than one machine. Now I know you're thinking 'why not just target users' well that is a good question. In this case I needed to add an exclude collection to the machine collection to prevent installation on certain machines. But if you ever find yourself in such a predicament. Here you go. 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_SYSTEM_CONSOLE_USER on SMS_G_System_SYSTEM_CONSOLE_USER.ResourceID = SMS_R_System.ResourceId inner join SMS_R_User on SMS_R_USER.UniqueUserName = SMS_G_System_SYSTEM_CONSOLE_USER.SystemConsoleUser Where SMS_R_User.UserGroupName = "Domain\\ADGroup"