Using Argon0's query I made a few minor adjustments and it now produces a dynamic list of machines whose users are members of a specified group. The key is to replace:
('COMMA', 'AND', 'QUOTE', 'SEPARATED', 'LIST', 'OF_USERS')
with:
(Select tblADusers.Username
From tblADusers Left Join tblADMembership On tblADMembership.ChildAdObjectID =
tblADusers.ADObjectID Left Join tblADGroups
On tblADMembership.ParentAdObjectID = tblADGroups.ADObjectID
Where tblADGroups.Name = 'Test_Group')
Here then is "
Computers: Test Group Virtual Machines" which produces a list of machines of the user members of "Test_Group" in order to run deployment packages against them. It is currently set to only show virtual desktops, to exclude machines in the OU "legacy," and to list only machines seen in the last 30 days:
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename As AssetType,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Domain,
tblAssetCustom.Model,
tblAssetCustom.Manufacturer,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssets.Mac As MACAddress,
tblADComputers.OU,
tblstate.Statename As State,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssets.Description,
tblAssetCustom.PurchaseDate,
tblAssetCustom.Warrantydate,
tblAssets.FQDN,
tblAssetCustom.DNSName,
tblAssetCustom.LastPatched,
tblAssetCustom.LastFullbackup,
tblAssetCustom.LastFullimage,
tblAssetCustom.Location,
tblAssetCustom.Building,
tblAssetCustom.Department,
tblAssetCustom.Branchoffice,
tblAssetCustom.BarCode,
tblAssetCustom.Contact,
tblAssetCustom.Serialnumber,
tblAssetCustom.OrderNumber,
Case tblAssetCustom.PreventCleanup When 0 Then 'No' When 1 Then 'Yes'
End As PreventCleanup,
tblAssets.Scanserver,
tblADComputers.Description As AD_Description,
tblAssets.Username
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Left Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblstate On tblstate.State = tblAssetCustom.State
Left Join tsysOS On tblAssets.OScode = tsysOS.OScode
Where tblAssetCustom.Manufacturer Like '%vmware%' And
tblADComputers.OU Not Like '%legacy%' And tblAssets.Lastseen > GetDate() - 30
And tblAssets.Username In (Select Top 1000000 tblADusers.Username
From tblADusers Left Join tblADMembership On tblADMembership.ChildAdObjectID =
tblADusers.ADObjectID Left Join tblADGroups
On tblADMembership.ParentAdObjectID = tblADGroups.ADObjectID
Where tblADGroups.Name = 'Test_Group')
Order By tblAssets.AssetName