Friday, December 09, 2005

daclark's WebLog

daclark's WebLog: "Comparing machines in SMS
Here's a query for comparing Services on two machines. Just Clone the 'Compare software inventory on two computers' report and replace the SQL with below.

select (case when inv1.Name0 is not null then @name1 else @name2 end) as Netbios_Name0,
(case when inv1.Name0 is not null then inv1.DisplayName0 else inv2.DisplayName0 end) as DisplayName0,
(case when inv1.Name0 is not null then inv1.Name0 else inv2.Name0 end) as Name0,
(case when inv1.Name0 is not null then inv1.StartMode0 else inv2.StartMode0 end) as StartMode0,
(case when inv1.Name0 is not null then inv1.StartName0 else inv2.StartName0 end) as StartName0

from ( select s.ResourceID, s.DisplayName0, s.Name0, s.PathName0, s.StartMode0, s.StartName0
from v_GS_Service s join v_R_System sys on s.ResourceID=sys.ResourceID where sys.Netbios_Name0 = @name1 ) as inv1

full outer join ( select s.ResourceID, s.DisplayName0, s.Name0, s.PathName0, s.StartMode0, s.StartName0
from v_GS_Service s join v_R_System sys on s.ResourceID=sys.ResourceID where sys.Netbios_Name0 = @name2 ) as inv2

on inv1.Name0=inv2.Name0 and inv1.StartMode0=inv2.StartMode0
where (inv1.Name0 is NULL) or (inv2.Name0 is NULL) order by DisplayName0, Name0, Netbios_Name0


Here's a query for comparing AddR"

No comments: