Selected Update Groups States listing required updates deployed to collection 600 None c4d8f81b-a374-4ee9-b298-41cba5214a3e CentralSite =Parameters!UserTokenSIDs.Value select dbo.fn_rbac_GetAdminIDsfromUserSIDs (@UserTokenSIDs) as UserSIDs UserSIDs System.String CentralSite =Parameters!UserSIDs.Value Select Distinct CollectionID, Name FROM dbo.fn_rbac_collection(@UserSIDs) order by Name true CollectionID System.String Name System.String CentralSite =Parameters!SUGS.Value =Parameters!UserSIDs.Value =Parameters!CollID.Value /* declare @CollID varchar(8) = 'Collection ID for Testing' DECLARE @UserSIDs VARCHAR(16); SELECT @UserSIDs = 'disabled'; */ declare @lcid as int set @lcid = dbo.fn_LShortNameToLCID('English') --Getting Deployments IDs select cia.AssignmentID as id into #ASSIGNID from fn_rbac_CIAssignmentToGroup(@UserSIDs) atg join fn_rbac_AuthListInfo(@lcid, @UserSIDs) ugi on ugi.CI_ID=atg.AssignedUpdateGroup join v_CIAssignment cia on atg.AssignmentID=cia.AssignmentID --where -- CI_ID in (17143786,17152698,17159821) -- Software update Goup Config Item ID for testing where CI_ID in (@SUGS) --report usage --Getting Updates States for updates in selected Update Groups select uc.ResourceID, uc.StateType, uc.StateID into #uct from v_UpdateState_Combined uc with (nolock) where uc.ResourceID in ( select ast0.ResourceID from v_CIAssignmentTargetedMachines ast0 where ast0.AssignmentID in (select id from #ASSIGNID)) and uc.CI_ID in ( select aci0.CI_ID from v_CIAssignmentToCI aci0 where aci0.AssignmentID in (select id from #ASSIGNID )) select uc.ResourceID, m.name0, m.Name0+'.'+m.Full_Domain_Name0 as ComputerName0, sn.StateName as Status ,count(sn.StateName) as countstatus into #updates_status from #uct uc join v_StateNames sn with (nolock) on sn.TopicType = uc.StateType and sn.StateID = uc.StateID join v_R_System m with (nolock) on m.ResourceID=uc.ResourceID and isnull(m.Obsolete0,0)=0 join (select vc1.ResourceID from v_FullCollectionMembership vc1 with (nolock) where vc1.CollectionID=@CollID) vc on vc.ResourceID=m.ResourceID where sn.StateName not like 'Update is not required' group by uc.ResourceID, m.Name0, m.Full_Domain_Name0, sn.StateName --Pivoting Data and setting overall Compliance State select *, case when [Update is installed] is not null and [Detection state unknown] is null and [Downloaded update] is null and [Installing update] is null and [Pending system restart] is null and [Successfully installed update] is null and [Update is required] is null and [Waiting for another installation to complete] is null and [Successfully installed update] is null and [Failed to download update] is null and [Failed to install update] is null and [General failure] is null and [Waiting for maintenance window before installing] is null then 'Compliant' when [Failed to download update] is not null or [Failed to install update] is not null or [General failure] is not null then 'Failed' when [Detection state unknown] is not null then 'State Unknown' else 'In Progress' end as [Compliancy] from #updates_status ts pivot(sum(countstatus) for [status] in ([Detection state unknown],[Downloaded update],[Failed to download update],[Failed to install update],[General failure],[Installing update],[Pending system restart],[Successfully installed update],[Update is installed],[Update is not required],[Update is required],[Waiting for another installation to complete],[Waiting for maintenance window before installing]) ) as results; --Cleanup drop table #updates_status drop table #ASSIGNID drop table #uct true name0 System.String ComputerName0 System.String ResourceID System.Int32 Detection state unknown System.Int32 Compliancy System.String Downloaded update System.Int32 Failed to download update System.Int32 Failed to install update System.Int32 General failure System.Int32 Installing update System.Int32 Pending system restart System.Int32 Successfully installed update System.Int32 Update is installed System.Int32 Update is not required System.Int32 Update is required System.Int32 Waiting for another installation to complete System.Int32 Waiting for maintenance window before installing System.Int32 CentralSite select CI_ID,title FROM v_AuthListInfo --where --title like '%required%' --and title not like '%office%' --and title not like '%pilot%' true CI_ID System.Int32 title System.String =Fields!Compliancy.Value =Fields!Compliancy.Value =Sum(Fields!Detection_state_unknown.Value) Axis Title False 0.5 NaN NaN NaN Axis Title False 0.5 NaN Opposite NaN NaN Axis Title 0.5 NaN NaN NaN Axis Title 0.5 NaN Opposite NaN NaN Black Black States Dispersion BrightPastel Yellow Khaki DarkViolet Purple LimeGreen Lime Gold Plum Tan HotPink LightGreen LightSteelBlue Black No Data Available New_Updates_Missing 0cm 12.82689cm 6.8415cm 37.10722cm White None =Fields!Compliancy.Value =Fields!Compliancy.Value =CountDistinct(Fields!ResourceID.Value) Axis Title False 0.5 NaN NaN NaN Axis Title False 0.5 NaN Opposite NaN NaN Axis Title 0.5 NaN NaN NaN Axis Title 0.5 NaN Opposite NaN NaN Black Black Compliancy BrightPastel LimeGreen Red Orange LightGrey No Data Available New_Updates_Missing 0cm 0cm 6.8415cm 12.79162cm 1 White None 8.03378cm 4.23567cm 2.5cm 2.5cm 2.5cm 2.754cm 2.5cm 2.5cm 2.5cm 2.5cm 3.262cm 3.0715cm 2.5cm 2.5cm 1.92014cm true true Computer Name #4c68a2 2pt 2pt 2pt 2pt true true ShortName #4c68a2 2pt 2pt 2pt 2pt true true Update is installed #4c68a2 2pt 2pt 2pt 2pt true true Failed to download update #4c68a2 2pt 2pt 2pt 2pt true true Failed to install update #4c68a2 2pt 2pt 2pt 2pt true true General failure #4c68a2 2pt 2pt 2pt 2pt true true Update is required #4c68a2 2pt 2pt 2pt 2pt true true Downloaded update #4c68a2 2pt 2pt 2pt 2pt true true Installing update #4c68a2 2pt 2pt 2pt 2pt true true Successfully installed update #4c68a2 2pt 2pt 2pt 2pt true true Waiting for maintenance window before installing #4c68a2 2pt 2pt 2pt 2pt true true Waiting for another installation to complete #4c68a2 2pt 2pt 2pt 2pt true true Pending system restart #4c68a2 2pt 2pt 2pt 2pt true true Detection state unknown #4c68a2 2pt 2pt 2pt 2pt 0.6cm true true =Fields!ComputerName0.Value =switch( Fields!Compliancy.Value="Compliant","Lime", Fields!Compliancy.Value="In Progress","LemonChiffon", Fields!Compliancy.Value="Failed","Pink", Fields!Compliancy.Value="State Unknown","WhiteSmoke") 2pt 2pt 2pt 2pt true true =Fields!name0.Value =switch( Fields!Compliancy.Value="Compliant","Lime", Fields!Compliancy.Value="In Progress","LemonChiffon", Fields!Compliancy.Value="Failed","Pink", Fields!Compliancy.Value="State Unknown","WhiteSmoke") 2pt 2pt 2pt 2pt true true =Sum(Fields!Update_is_installed.Value) Lime 2pt 2pt 2pt 2pt true true =Sum(Fields!Failed_to_download_update.Value) Pink 2pt 2pt 2pt 2pt true true =Sum(Fields!Failed_to_install_update.Value) Pink 2pt 2pt 2pt 2pt true true =Sum(Fields!General_failure.Value) Pink 2pt 2pt 2pt 2pt true true =Sum(Fields!Update_is_required.Value) LemonChiffon 2pt 2pt 2pt 2pt true true =Sum(Fields!Downloaded_update.Value) LemonChiffon 2pt 2pt 2pt 2pt true true =Sum(Fields!Installing_update.Value) LemonChiffon 2pt 2pt 2pt 2pt true true =Sum(Fields!Successfully_installed_update.Value) LemonChiffon 2pt 2pt 2pt 2pt true true =Sum(Fields!Waiting_for_maintenance_window_before_installing.Value) LemonChiffon 2pt 2pt 2pt 2pt true true =Sum(Fields!Waiting_for_another_installation_to_complete.Value) LemonChiffon 2pt 2pt 2pt 2pt true true =Sum(Fields!Pending_system_restart.Value) LemonChiffon 2pt 2pt 2pt 2pt true true =Sum(Fields!Detection_state_unknown.Value) WhiteSmoke 2pt 2pt 2pt 2pt 0.6cm true true =CountDistinct(Fields!ResourceID.Value) =switch( Fields!Compliancy.Value="Compliant","MediumSeaGreen", Fields!Compliancy.Value="In Progress","PaleGoldenrod", Fields!Compliancy.Value="Failed","LightCoral", Fields!Compliancy.Value="State Unknown","Gainsboro") 2pt 2pt 2pt 2pt true true =switch( Fields!Compliancy.Value="Compliant","MediumSeaGreen", Fields!Compliancy.Value="In Progress","PaleGoldenrod", Fields!Compliancy.Value="Failed","LightCoral", Fields!Compliancy.Value="State Unknown","Gainsboro") 2pt 2pt 2pt 2pt true true =Sum(Fields!Update_is_installed.Value) MediumSeaGreen 2pt 2pt 2pt 2pt true true =Sum(Fields!Failed_to_download_update.Value) LightCoral 2pt 2pt 2pt 2pt true true =Sum(Fields!Failed_to_install_update.Value) LightCoral 2pt 2pt 2pt 2pt true true =Sum(Fields!General_failure.Value) LightCoral 2pt 2pt 2pt 2pt true true =Sum(Fields!Update_is_required.Value) PaleGoldenrod 2pt 2pt 2pt 2pt true true =Sum(Fields!Downloaded_update.Value) PaleGoldenrod 2pt 2pt 2pt 2pt true true =Sum(Fields!Installing_update.Value) PaleGoldenrod 2pt 2pt 2pt 2pt true true =Sum(Fields!Successfully_installed_update.Value) PaleGoldenrod 2pt 2pt 2pt 2pt true true =Sum(Fields!Waiting_for_maintenance_window_before_installing.Value) PaleGoldenrod 2pt 2pt 2pt 2pt true true =Sum(Fields!Waiting_for_another_installation_to_complete.Value) PaleGoldenrod 2pt 2pt 2pt 2pt true true =Sum(Fields!Pending_system_restart.Value) PaleGoldenrod 2pt 2pt 2pt 2pt true true =Sum(Fields!Detection_state_unknown.Value) Gainsboro 2pt 2pt 2pt 2pt 0.6cm true true =CountDistinct(Fields!ResourceID.Value) #7292cc 2pt 2pt 2pt 2pt true true #7292cc 2pt 2pt 2pt 2pt true true =Sum(Fields!Update_is_installed.Value) Green 2pt 2pt 2pt 2pt true true =Sum(Fields!Failed_to_download_update.Value) Red 2pt 2pt 2pt 2pt true true =Sum(Fields!Failed_to_install_update.Value) Red 2pt 2pt 2pt 2pt true true =Sum(Fields!General_failure.Value) Red 2pt 2pt 2pt 2pt true true =Sum(Fields!Update_is_required.Value) Yellow 2pt 2pt 2pt 2pt true true =Sum(Fields!Downloaded_update.Value) Yellow 2pt 2pt 2pt 2pt true true =Sum(Fields!Installing_update.Value) Yellow 2pt 2pt 2pt 2pt true true =Sum(Fields!Successfully_installed_update.Value) Yellow 2pt 2pt 2pt 2pt true true =Sum(Fields!Waiting_for_maintenance_window_before_installing.Value) Yellow 2pt 2pt 2pt 2pt true true =Sum(Fields!Waiting_for_another_installation_to_complete.Value) Yellow 2pt 2pt 2pt 2pt true true =Sum(Fields!Pending_system_restart.Value) Yellow 2pt 2pt 2pt 2pt true true =Sum(Fields!Detection_state_unknown.Value) LightGrey 2pt 2pt 2pt 2pt 6.07717cm true true Compliancy #4c68a2 2pt 2pt 2pt 2pt After =Fields!Compliancy.Value =Fields!Compliancy.Value 6.07717cm true true =Fields!Compliancy.Value =switch( Fields!Compliancy.Value="Compliant","Green", Fields!Compliancy.Value="In Progress","Yellow", Fields!Compliancy.Value="Failed","Red", Fields!Compliancy.Value="State Unknown","LightGrey") 2pt 2pt 2pt 2pt =sum(Fields!Detection_state_unknown.Value+Fields!Downloaded_update.Value+Fields!Failed_to_download_update.Value+Fields!Failed_to_install_update.Value+Fields!General_failure.Value+Fields!Installing_update.Value+Fields!Pending_system_restart.Value+Fields!Successfully_installed_update.Value+Fields!Update_is_installed.Value+Fields!Update_is_not_required.Value+Fields!Update_is_required.Value+Fields!Waiting_for_another_installation_to_complete.Value+Fields!Waiting_for_maintenance_window_before_installing.Value) Descending =Fields!ComputerName0.Value true Compliancy Before 6.07717cm true true Total #7292cc 2pt 2pt 2pt 2pt Before New_Updates_Missing 6.985cm 0cm 3.72014cm 49.93412cm 2 11.30514cm Textbox26 0.01042in 1.67583in 0.39792in 2.48958in #fdfdfb #fdfdfb #fdfdfb #e1e1e1 Middle 2pt 2pt 2pt 2pt true 0.04208in 0.54847in 19.6591in #2b627f External /Report Parts/visma_menu.png b0ead978-166b-4c08-a249-2ca686afa7d8 /Report Parts/Header 2015-04-15T16:34:21.0270000+02:00