OK - this is the hardware summary report edited with the suggested above details by Mclemson. No wi Hope they are in the right place ..
DECLARE @v1_TrusteeScope nvarchar(max)
SET @v1_TrusteeScope = N'%TrusteeScope%'
SELECT DISTINCT i.Guid, Item.Name as 'Group Name'
CASE WHEN i.Domain = '' AND CHARINDEX('.', i.[Name]) <> 0 THEN SUBSTRING (i.[Name],0,CHARINDEX ('.',i.[Name])) ELSE i.[Name] END [Name],
CASE WHEN i.Domain = '' AND CHARINDEX('.', i.[Name]) <> 0 THEN REPLACE (i.[Name],SUBSTRING (i.[Name],0,CHARINDEX ('.',i.[Name]))+ '.','') ELSE i.Domain END [Domain],
hs.[Vendor Name] [Manufacturer],
sn1.[Model] [Computer Model],
cpu.[Max Clock Speed (Mega-hertz)] [CPU Frequency],
cpu.[Family] [CPU Type],
hs.[Total RAM] / (1024 * 1024) [Memory (MB)],
ISNULL (i.[OS Name],os.[Name]) [Operating System],
d.[OS Version] [OS Version],
hs.[Total fixed drive size] / (1024) [Disk Size(MB)],
ld.[Free Space (Bytes)] [Free Space(MB)],
sn1.[Identifying Number] [Serial Number],
IAD.[Distinguished Name] [OU AD]
FROM dbo.vComputer i
JOIN dbo.ScopeMembership sm
ON sm.[ResourceGuid] = i.Guid
AND sm.[ScopeCollectionGuid] IN (SELECT * FROM dbo.fnGetTrusteeScopeCollections (@v1_TrusteeScope))
LEFT JOIN dbo.Inv_AeX_AC_Identification d
ON d._ResourceGuid = i.Guid
JOIN dbo.CollectionMembership cm
ON cm.ResourceGuid = i.[Guid]
JOIN dbo.vCollection it
ON it.Guid = cm.CollectionGuid
LEFT JOIN dbo.vHWPhysicalMemory m1
ON m1.[_ResourceGuid] = i.Guid
LEFT JOIN dbo.vHWComputerSystem sn1
ON sn1.[_ResourceGuid] = i.Guid
LEFT JOIN dbo.vHWProcessor cpu
ON cpu.[_ResourceGuid] = i.[Guid]
LEFT JOIN (SELECT SUM ([Free Space (Bytes)] / (1024 * 1024)) [Free Space (Bytes)], _ResourceGuid
FROM dbo.vHWLogicalDisk GROUP BY _ResourceGuid) ld
ON i.Guid = ld._ResourceGuid
LEFT JOIN dbo.vOSOperatingSystem os
ON os._ResourceGuid = i.Guid
JOIN dbo.Inv_Operating_System_Summary oss
ON oss.ComputerResourceGuid = i.Guid
JOIN dbo.Inv_Hardware_Summary hs
ON hs.ComputerResourceGuid = i.Guid
LEFT OUTER JOIN dbo.Inv_Global_Active_Directory_Details IAD
ON i.Guid = IAD._ResourceGuid
JOIN dbo.ScopeCollection sc
ON sm.ScopeCollectionGuid=sc.ScopeCollectionGuid
JOIN Item
ON sm.ScopeCollectionGuid=Item.SecurityGuid
WHERE 1 = 1
AND LOWER (i.[Name]) LIKE LOWER ('%ComputerName%')
AND i.Domain LIKE '%Domain%'
AND lower (it.[Guid]) LIKE lower ('%Filter%')
AND sc.ScopeSetGuid='{9fe89aed-9054-4465-84df-d1c945bbc834}'
I excute this in SQL studio express and get the folowing errors :
Msg 156, Level 15, State 1, Line 6
Incorrect syntax near the keyword 'CASE'.
Msg 156, Level 15, State 1, Line 23
Incorrect syntax near the keyword 'LEFT'.
Msg 102, Level 15, State 1, Line 36
Incorrect syntax near 'ld'.
And it being run agains the correct database also.
Joe.