Quantcast
Channel: SCCM Reports – All about Microsoft Endpoint Manager
Viewing all 98 articles
Browse latest View live

SCCM Configmgr 2012 How to get list of VMs running on each Hyper-V server in your environment?

$
0
0

I got a request asking for “is there a way to find out the VM’s that are configured on each Hyper-V server ,if so ,how to I generate a report with its Base/Host Name and its VMS running on it with its possible VM setting info “.

hmm..Getting VM’s that are running on Hyper-V and its VM properties ?  okay,if the VMs are running on hyper-V ,then these should be registered in WMI Name space .

I then Started digging to find some information about Hyper-V and its stored location in WMI .

Couple of blogs that I come across during my search.

http://blogs.msdn.com/b/virtual_pc_guy/archive/2012/05/30/the-v2-wmi-namespace-in-hyper-v-on-windows-8.aspx

and http://msdn.microsoft.com/en-us/library/hh850319(v=vs.85)

https://blueprints.launchpad.net/neutron/+spec/hyper-v-wmi-v2

From the above blogs,I captured some important information which will be be helpful:

if you are running VMS on Windows 8 or server 2012,the name space for the VM’s located is  called V2 Name Space (root\virtualization\v2),to know more about why V2,read this blog .

If you are running VMs on server 2003 or server 2008, the Name Space for the VM’s located is called V1 (root\virtualization).

In short: OS <= 2008 R2: V1 (root\virtualization) , OS >= 2012: V2 ( ).

This request can be achieved using Configuration manager 2012 and I think its not that difficult for someone who already experienced with importing /Adding Custom MOF properties into Hardware inventory settings.

Before I jump into the configuration part ,I need to get/verify what information is stored in WMI name space for the VM’s. Refer this blog to know attribute values from Msvm_ComputerSystem class.

From the existing values,I choose to get important values like Elementname,Caption,Enabledstate,Installdate,Enabledefault,TimeOfLastStateChange,TimeOfLastConfigurationChange.

Run the below powershell query ,to see its values for each VM:

gwmi -namespace "root\virtualization\v2" MSVM_ComputerSystem |select elementname,caption,
enabledstate,installdate,enabledefault,TimeOfLastStateChange,TimeOfLastConfigurationChange |Out-GridView

I get something like below on my windows 8.1 machine:

image22 thumb SCCM Configmgr 2012 How to get list of VMs running on each Hyper V server in your environment?

we have now identified what values we want to be present in SQL/SSRS Report.

Having this information in place,one would think ,we can get this information by enabling the custom inventory class from root\virtualization\v2  Msvm_ComputerSystem but if you configure this way ,client will fail to retrieve the information from WMI and you end up with following error from inventoryagent.log

error msg: Unknown error encountered processing an instance of class Msvm_ComputerSystem: 80041001

image thumb SCCM Configmgr 2012 How to get list of VMs running on each Hyper V server in your environment?

As per the configurations from client device settings,it is trying to run query SELECT __CLASS, __PATH, __RELPATH, CreationClassName, Name, ElementName, EnabledState, InstallDate, TimeOfLastConfigurationChange, TimeOfLastStateChange FROM Msvm_ComputerSystem against namespace root\virtualization\v2 and is failing to do so.

image thumb1 SCCM Configmgr 2012 How to get list of VMs running on each Hyper V server in your environment?

Thanks to Mof Moster (Sherry Kissinger) for providing the solution to make this working.

Solution :

In order to get the VM info Into CM Database,we need to create custom name space in WMI (cm_msvmcomputersystem) ,Pipe the vm info from  Msvm_ComputerSystem and then try import that info CM DB using MOF file.

This setup requires you to create Configuration Items ,import the MOF file into Client Device Settings and Run report.

Note :This solution will work for hyper-V running server 2008/R2,windows 8/8.1,server 2012/R2 with namespace root\virtualization or root\virtualization\v2.

If you have any other namespace that store the VM’s ,you may need to edit the Powershell Script in CI,also the MOF file.

Download the Attached CI Cab file,MOF file and SQL Report with instructions from here

on your client ,refresh the machine policy,you would see ,the CI as compliant.

image thumb2 SCCM Configmgr 2012 How to get list of VMs running on each Hyper V server in your environment?

check if the namespace (cm_msvmcomputersystem) created in WMI or not ?

image thumb3 SCCM Configmgr 2012 How to get list of VMs running on each Hyper V server in your environment?

Run the Inventory action ,should see something like below :

image thumb4 SCCM Configmgr 2012 How to get list of VMs running on each Hyper V server in your environment?

wait for a while before site server process this information.

SQL Report:

image thumb5 SCCM Configmgr 2012 How to get list of VMs running on each Hyper V server in your environment?

Hope It Helps!

SCCM Configmgr 2012 How to get list of VMs running on each Hyper-V server in your environment? is a post from: Eswar Koneti's Blog


Configmgr 2012 query how to get list of applications that requires approval

$
0
0

This is quick post on how to get list of Applications that are deployed to users requires approval . more Details ,refer https://social.technet.microsoft.com/Forums/en-US/644ff540-4eb0-49b6-97f4-094cada74c6a/viewing-deployments-that-require-approval?forum=configmanagerapps

Run the following SQL query to know apps that require Approval.

select app.displayname [Application Name],app.manufacturer [Manufacturer],app.numberofdeviceswithapp [No of Devices with this App],app.numberofuserswithrequest [No of Requests] from fn_ListApplicationCIs(1033) app,
v_UserTargetedApps uta
where uta.ci_id=app.ci_id
and uta.requireapproval=1
order by app.displayname

fn_ListApplicationCIs(1033) contains other important information ,so you can add all of them here if you need. To know what info ,fn_ListApplicationCIs(1033) has ,just run select top 5 * From fn_ListApplicationCIs(1033) ,gives you the first 5 rows .

Reference: http://myitforum.com/myitforumwp/2013/01/11/query-configmgr-database-for-applications-that-require-admin-approval/

Configmgr 2012 SQL Views http://eskonr.com/2013/10/download-sccm-configmgr-2012-r2-sql-views/

Configmgr 2012 query how to get list of applications that requires approval is a post from: Eswar Koneti's Blog

SCCM Configmgr 2012 SSRS Patch Compliance Report Per Collection Per Update Group

$
0
0

In order to check the Patch compliance/Deployment status,there are some default reports ,one of the widely used report to know the compliance status for specific Update group on specific collection is –>Compliance 1-Overall Compliance.

But the sub report /drill down/Linked report to view the list of non complaint computers do not provide you the required information for troubleshooting clients like its last hardware inventory, os, last logged on user, last loggedon timestamp etc.For this reason,I created custom SSRS Report that will help me to get some nice statistics and extra client information .

Last month I did post about Software update Patch Compliance report Per OU Per Update Group to get the patch compliance status based on OU.

This time ,I would like to share another Software Update Compliance report per Collection Per Update Group with linked report to list non-compliant computers.

Here is the first report to know compliance % per collection.

image

Drill down report to list the non-Compliant computers (Required/UnKnown):

image

 

Download the RDL Files available from TechNet Gallary ,upload to your SSRS Reports,change the Data source .

Happy troubleshooting .

How to get Report for Internet Explorer Startup Page using Configuration Manager 2012

$
0
0

Last week,I was having a discussion with manager about the User IE Home page/Start page to get report on, how many users are set to Company intranet Page.I then asked him,what is the method ,company currently follow to set IE Home page .He then replied,GPO ? my response for this  was,if GPO,then the Home page for IE should be set to the required one for all Domain Users (Domain users: where ever the GPO applied to) and using GPO,will have more control to restrict user to not to change the default IE Home page (Disable changing home page settings. and less troubleshooting required .

I check my computer,the Default IE Home Page set to the correct one but I do have flexibility to change it to custom. So boss asked me to try if there is way to get a compliance report on User IE Home page ,in case the GPO may not be applied to some of the OU to be identified.

Since the IE Home Page information stored in HKCU,we cannot use regkeytomof (it works only with HKLM) or MOF Extension or DCM (not easy).

The possible solution for this is involved with, 1) Create Custom WMI location 2) Copy the User IE home page info into this location 3)Edit the MOF to retrieve this WMI information into SCCM Database.

The above solution would work but how would you provide full permissions to WMI location to publish the User Registry info ? If users do not have admin rights on their computers ?

Long ago,there was a discussion on sccm forum list ,about the this issue to get User IE home pages Using Configuration manager.Our MOF Master Sherry Kissinger has got workaround for this issue which I am going shortly.

This procedure requires creation  of  package with 2 programs (legacy is preferred and easy) 1) machine 2 ) User with dependency on machine.

Create a folder with standard naming convention as per required on your network share and place these files into it .files can be downloaded from  http://eskonr.com/?wpdmdl=5651

image

1.wmiNameSpaceandSecurity.vbs—>This script will create custom WMI name location ( root\CustomCMClasses—>CM_IEStartPages) using file called WmiSecurity.exe.

2.UserIEStartPage.vbs:This script publish the information from HKCU to custom WMI name location which is created using above script.

Before we start creating the packages,edit the script wmiNameSpaceandSecurity.vbs and replace the domain name to your domain name and save the script.

image

Create Package with 2 programs:

1.Create package with program cmd line: cscript.exe wminamespaceandsecurity.vbs under system context

image

2. Right click on the package created above and select Create program  (no need to create new package) with cmd line:cscript.exe UserIEStartPage.vbs under user context

and select ‘Run another program profile first’

image

image

we now created package with 2 programs :

image

Distribute the package to DP group or DP’s.

Now create deployment using UserIEStartPage to required collection.

Time to test the results:

Login to PC that has this deployment ,run machine policy ,monitor execmgr.log for progress of this deployment.

image

from above log, program executed successfully.

lets checkout the WMI classes and inventory information what is captured from HKCU.

open cmd and type wbemtest.exe ,connect to “root\CustomCMClasses

image

lets checkout the homepage values from WMI class using simple WQL Query before we start working with MOF file.

while you are connected to “root\CustomCMClasses” ,Click on Query and use this query to run: SELECT * FROM CM_IEStartPages

image

From above, se see that ,User has set 2 tabs when IE Opens.Double click on either of the one and click on show MOF to see the URL page.

image

So far, All good. Now lets try doing some changes to the MOF to collect this information via Inventory on schedule basis (If Required,crate custom inventory to specific collection instead of doing it on default ).

Go to your CM12 Primary Site administration pane (if you have CAS then you should do make these changes there )—>client settings—Default settings. (You must import the custom attributes here before you create custom client settings.

image     image     image   image

we have now imported the custom WMI info into CM12 but we did not enable this setting to be collected from Configmgr clients.

on the background,Configmgr will be creating new table/view (CM_IESTARTPAGES_DATA/v_GS_CM_IESTARTPAGES) to store the information that comes from clients which can be monitor from dataldr.log from your Site server logs:

imageNow ,Create custom client agent setting that can be applied onto test collection before making to Big collection .

image          image

Deploy this setting to test collection and wait for the results (client should pick the new settings and send the inventory info to Site server). After a while,you see the information in CM12 Database.

Here is the Simple SQL Query:

image

SELECT  vrsv.Netbios_Name0 [machine name],isp.username0,isp.startpage0,isp.tab0,isp.datescriptran0
FROM v_GS_CM_IESTARTPAGES IsP,dbo.v_R_System_Valid AS vrsv
WHERE vrsv.ResourceID=isp.resourceid

SCCM 2012 SSRS Report Content Summary With distribution Status

$
0
0

 

This week SSRS report is about knowing the count of applications,packages,driver packages,SUP packages,boot images,OS images,Virtual packages etc into Nice Pie Chart also know about the Distribution status of each package .

This report has 2 queries inside SSRS 1) for Pie Chart and 2)list the Distribution Status for each package with sorting order.

Its always nice to know the figure on the content ,content success status.

image

Download the SSRS Report(.RDL) from TechNet Gallary,Upload to your SSRS Report,change the Database source.

List of SCCM Configmgr Technical Preview Default reports

$
0
0

Exploring the recently released Configuration manager Tech preview (60 days evolution ) by Microsoft in my lab.It has got some nice features like Management rotation,Auto Client upgrade to collection,OSD and other things.

I was looking at reports what has been added extra compared to Configuration manager 2012 R2 CU4 (this my present CM level).

Configmgr tech preview has got total of 494 reports by default which is more compared to Configmgr 2012 (444 ,With R2 CU level  491 reports) .

Below reports are appearing as new in Tech preview version:

1.List of noncompliant Apps and Devices for a specified user

2.Summary of Users who have Noncompliant Apps

3.Compliance status of default ActiveSync mailbox policy for the mobile devices that are managed by the Exchange Server connector

4.List of devices by Conditional Access State

5.List of Devices enrolled per user in Microsoft Intune

6.Number of devices enrolled per user in Microsoft Intune

Download the list of default reports from Configuration manager tech Preview version here

I have also posted the Configuration Manager 2012 R2 CU4 default reports here for download.

I have used the below SQL query to get list of reports available against the reportserver database:

Select   Name,Description,SubString(Path,1,Len(Path) - (CharIndex('/',Reverse(Path))-1)) As Path,
Case When Hidden = 1 Then  'Yes' Else 'No' End As Hidden
From  Catalog
Where Type = 2
Order By SubString(Path,1,Len(Path) - (CharIndex('/',Reverse(Path))-1)),Name

Note:

Type 2—For Reports

Type 1—For Folder Names

Type 5 --For Data source

SCCM Configmgr 2012 Report Application Deployment results for specific application for specific OU

$
0
0

Started rolling out MS office 2013 to Users few weeks ago.For this ,created collection to get computers with MS office 2010 ,created application for MS office 2013 upgrade and deploy to collection .This collection consists of computers from different departments,business units etc.

Colleague of mine asked me if there is way to get report for deployment status of specific application for specific OU. The reason for this requirement is that ,he wanted to get the deployment status per business unit (location)for the deployed application. OUs in AD are named with location names .

A single collection (MS office 2013 upgrade ) consist of computers from several business units and he wants to see the status per business unit for reporting.

The default report ‘All Application Deployment (basic)’ from software distribution—Application monitoring category works on specific collection and this collection contains the computers from different business units (Locations  which are nothing but OU’s ) did not work for this requirement. Must create new report to get the deployment status results for specific application for specific business unit.

So I started looking out for the Configmgr 2012 R2 SQL tables/sql views using the Configmgr 2012 R2 SQL views spread sheet .

I created report which can be used to find the deployment status of any application (but not packages) for specific OU.

Note: This report will list the computers on which the deployment ran or atleast the computer received policy about the deployment. For ex: An OU contains 200+ computers but the collection contains only 50 Computers from this specific OU so when you run this report,you may only see results for these 50 computers but not 200+. Also remember that,this report will not give you the error description for the computer when did the deployment is failed . It requires little more work to get the description from dll files in SSRS and will update this post when am done.

When you run the report ,you will have to select the OU ,you will see list of all OU’s from your AD .It may look ugly  with all OUs and sub OU etc but you can fine tune the SQL query this to get the child OU only.

Report is based on the Deployment status :

Success
In Progress
Requirements Not Met
Unknown
Error

This report contains 2 sub reports 1)Overall deployment status results with nice pie chart for specific application for specific OU 2) sub report to get the list of computers with specific specific for the selected application .

Deployment chart summary for specific application :

image

 

Sub report to list computers with specific status for application for OU (click on the Pie chart to get list of computers with specific status):

image

 

Download the RDL files from TechNet gallery here ,upload the RDL files to your SSRS Folder (keep both these files in same folder as they are linked),change the Data source and run it.

SCCM Configmgr 2012 How to Extract information from XML file stored in SQL DB for application properties

$
0
0

 

Last week,I was working on request to get the application information which includes Application Name ,Deployment Type ,Content location,Command lines (install and uninstall),what type of deployment is it,detection type,user requirement  and other information. Since there are no default reports to get this kind of information ,you must consider writing new SQL/SSRS report else go manual procedure to write down the information for the applications.

In Configmgr 2007 and Configmgr 2012 ,the information about packages like installation command line,uninstallation,requirements (windows 7,windows 8) and other properties can be retried directly from SQL database without any trouble but if you consider the same requirement for applications,its different story.

In configmgr 2012,the application information is not stored directly as you see for packages ,instead it is stored in .XML file (SDMPackageDigest) .So retrieving this information might require additional SQL skills .It took little while for me to figure this out. Information about applications and its properties is stored in different views or I would call them as functions. Some of them are v_ConfigurationItems, dbo.fn_ListApplicationCIs(1033),dbo.fn_ListDeploymentTypeCIs 1033),dbo.fn_ListApplicationCIs_List(1033) etc.

Couple of reference articles helped me to achieve this report are :http://blogs.technet.com/b/hhoy/archive/2012/07/19/how-to-query-configuration-manager-2012-xml-data-with-sql-xquery.aspx and https://msdn.microsoft.com/en-IN/library/ms177400.aspx?

Lets jump into the subject line to extract the information stored in XML file .

AS I said above,the application properties includes deployment type,install,uninstall and properties that you see within the application+deployment type are stored in table with column called:SDMPackageDigest ,For more ,please read here.

image

AS I highlighted in above screen in red color,all the fields information is stored in one XML file for each deployment type. For ex: if you have application with 3 deployment types,you will have 3 XML files that store the information.

To see how the XML store the information ,you can simply run the below Query to display top 10 application information and click on the SDMPackageDigest. It will pop-up XML file .

select TOP 10 * from vCI_ConfigurationItems where CIType_ID = '21'

CIType_ID=21 is for applications.

XML File:

image

To create report, I like to use functions (dbo.fn_ListApplicationCIs(1033) and dbo.fn_ListDeploymentTypeCIs(1033) ) to retrieve the information instead of using views as functions always executes faster compare to views.

I have presented the most used and limited information in this report .You can still add other information which you might be interested from the XML file using the same logic .

SQL Query:

You can take the below SQL syntax to create SSRS Report (I will post the RDL file soon ) or run this query in  SQL server Management studio .

;WITH XMLNAMESPACES ( DEFAULT 'http://schemas.microsoft.com/SystemsCenterConfigurationManager/2009/06/14/Rules', 'http://schemas.microsoft.com/SystemCenterConfigurationManager/2009/AppMgmtDigest' as p1)
SELECT
A.[App Name],max(A.[DT Name])[DT Title],A.Type
,A.ContentLocation ,A.InstallCommandLine,A.UninstallCommandLine,A.ExecutionContext,A.RequiresLogOn
,A.UserInteractionMode,A.OnFastNetwork,A.OnSlowNetwork,A.DetectAction
from (
SELECT LPC.DisplayName [App Name]
,(LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Title)[1]', 'nvarchar(max)')) AS [DT Name]
,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/@Technology)[1]', 'nvarchar(max)') AS [Type]
,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:Contents/p1:Content/p1:Location)[1]', 'nvarchar(max)') AS [ContentLocation]
,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:InstallAction/p1:Args/p1:Arg)[1]', 'nvarchar(max)') AS [InstallCommandLine]
,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:UninstallAction/p1:Args/p1:Arg)[1]', 'nvarchar(max)') AS [UninstallCommandLine]
,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:InstallAction/p1:Args/p1:Arg)[3]', 'nvarchar(max)') AS [ExecutionContext]
,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:InstallAction/p1:Args/p1:Arg)[4]', 'nvarchar(max)') AS [RequiresLogOn]
,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:InstallAction/p1:Args/p1:Arg)[8]', 'nvarchar(max)') AS [UserInteractionMode]
,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:Contents/p1:Content/p1:OnFastNetwork)[1]', 'nvarchar(max)') AS [OnFastNetwork]
,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:Contents/p1:Content/p1:OnSlowNetwork)[1]', 'nvarchar(max)') AS [OnSlowNetwork]
,LDT.SDMPackageDigest.value('(/p1:AppMgmtDigest/p1:DeploymentType/p1:Installer/p1:DetectAction/p1:Provider)[1]', 'nvarchar(max)') AS DetectAction
FROM
dbo.fn_ListApplicationCIs(1033) LPC
RIGHT Join fn_ListDeploymentTypeCIs(1033) LDT ON LDT.AppModelName = LPC.ModelName
where LDT.CIType_ID = 21 AND LDT.IsLatest = 1
) A
GROUP BY A.[App Name],A.Type,A.ContentLocation,A.InstallCommandLine,A.UninstallCommandLine,A.ExecutionContext,A.RequiresLogOn,A.UserInteractionMode,
A.OnFastNetwork,A.OnSlowNetwork,A.DetectAction

Results:

image

when you copy paste ,take care of quotes (‘), sometimes blog convert them to fancy quotes.

Download the SSRS Report (.RDL) file from TechNet Gallary here .

Upload the RDL file to your SSRS Report folder,change the data source,run the report.


SCCM Configmgr 2012 Updated Patch Compliance reports for software update group and collection with patch progression

$
0
0

 

Few months ago,I blogged about  SCCM Configmgr 2012 SSRS Patch Compliance Report Per Collection Per Update Group .This report tells you ,how your specific software update group (list of patches) is performing on specific collection(list of computers). It has linked report to see what computers are non-compliant for troubleshooting with some additional client information if you compare with default compliance report.

In this post, I have made some changes and bring additional report called patch progression report (have added installed patches to the report) to show how patches each PC is missing and installed with client information like OS,Last hardware scan etc. This information is available on the 2nd report when you click the computer name to see patch progression .

Note: The patch progression report is build only for critical,security updates excluding superseded and expired updates. so Ii f your company is deploying other classification of patches like update classification,service packs etc ,you will have to modify 3rd report .

You might wonder why the installed patches count is less , this count (patches) is installed via SCCM but not other methods of installation (manual or other way).

The first report looks like this (Patch compliance report per collection per software update group):

image

Click on the required or Unknown count to see the list of computers for troubleshooting.

image

 

The above 2 reports are old,nothing changed, but the next report (below) is newly added and linked to the 2nd report . Click on the computer name to see the count of installed and missing patches.

image

 

Download all these 3 reports from TechNet here ,upload to your SSRS reports folder (make sure all 3 should be in one folder) ,change the Data source ,run it.

Additional patch compliance reports if you are interested in those .

http://eskonr.com/2015/03/configmgr-2012-sql-query-count-updates-from-software-update-groups-if-they-are-bigger-than-hard-limit-1000-or-not/

http://eskonr.com/2015/03/configmgr-sql-query-get-software-updates-that-are-downloaded-but-not-in-any-software-update-group/

http://eskonr.com/2015/03/configmgr-2012-check-patch-is-member-of-what-software-update-package/

http://eskonr.com/2014/11/sccm-configmgr-2012-ssrs-report-overall-compliance-per-update-group-per-collection-will-help-to-troubleshoot-the-clients/

http://eskonr.com/2014/11/sccm-configmgr-2012-patch-report-ou-based-compliance-status-per-update-group/

SCCM Configmgr 2012 SSRS Report How to check content is used in what task sequences before cleanup using Cascading Parameters

$
0
0

Recently I was doing some content cleanup (mainly for images) in Configmgr 2012 R2 .I have found lot a images for each OS (windows 7,Windows 8 and Windows 8.1) with different versions ,especially for windows 10 .Before I delete ,I was looking for some default report to check if any of these old versions are used in any of the production or non production task sequences (there are many) ,but I could not find any such report to check. If I have one or two tasks sequences, I can go to the task sequence and look at reference tab to check if the image is used in the task sequence . So I thought of creating SSRS report to check particular image (this report can be used to check for any package,application,OSD,driver package etc) is used in what task sequences/or no task sequences, so that I can take a decision if the images can be deleted or not.

This report can be used to check any reference package used in what task sequence and then you can send email to the team with this information to check and revert back before you take any action .

When you run the SSRS Report,it will prompt to select the package type (application,Package,boot image,OS Image, OS Install package and driver package) followed by package name based on your selection of package type. This SSRS Report uses cascading parameters which means,prompt parameter depends on another prompt parameter that you choose.

Here is the SQL Query if you want to run from SQL Management studio:

select TP.name [TS Name],TP.packageID [TS ID],TP.Description,TP.sourcesite From v_TaskSequenceReferencesInfo TSR
inner join v_TaskSequencePackage TP on TP.PackageID=TSR.PackageID
inner join v_Package pkg on pkg.packageid=tsr.packageid
where referencepackageid='P0100144'
order by 1

Change the package ID to your respective content ID.

if you wanted to get list of applications,packages with package ID,Package Name,use the following SQL Query:

select
pkg.Name as [Package Name],
Case pkg.PackageType
When 0 Then 'Software Distribution Package'
When 3 Then 'Driver Package'
When 4 Then 'Task Sequence Package'
When 5 Then 'software Update Package'
When 6 Then 'Device Settings Package'
When 8 Then 'Application'
When 7 Then 'Virtual Package'
When 257 Then 'Image Package'
When 258 Then 'Boot Image Package'
When 259 Then 'OS Install Package'
Else ' '
END AS 'Package Type',
pkg.PackageID
from v_Package pkg
order by 2

SSRS Report:

image

Prompt:

image

Download the SSRS Report from Technet Gallery ,uploaded to your Configmgr reports folder ,change the Data source ,run the Report.

SSRS Report Cascading reference :https://msdn.microsoft.com/en-us/library/dd255197.aspx

SCCM Configmgr SQL Report get list of machines with one Version of application and exclude other versions

$
0
0

 

If you have same application with multiple versions installed on machines for ex: JAVA ,it allow to have multiple versions with same name like JAVA 6 update 45,JAVA 7 update 65 and so on….

How do you find computers that have single version application installed and exclude computers that have multiple versions with same name Installed ?

This scenario can be applicable to other applications (like Microsoft Office)  that allow multiple versions on same computer .

Example : I have client A,B and C out of which ,A and B has 3 versions of JAVA installed where as C is installed with One Version of JAVA and want get PC C into the Query results.

We will get this done using concept called Subselect query. Full Details https://social.technet.microsoft.com/Forums/en-US/a1d013ac-34fc-4486-9747-56e3d0027d9f/softwareinventory-query?forum=configmanagergeneral#108b932b-e91c-4b09-8abf-7fbf5701c588

SQL Code:

select sub.name0,arp1.DisplayName0,arp1.Version0

from

(

select

vrs.Name0,vrs.ResourceID,

COUNT(*) Total

from v_Add_Remove_Programs ARP

inner join v_R_System vrs on ARP.ResourceID = VRS.ResourceID

where arp.DisplayName0 like 'Java%'

group by vrs.Name0,vrs.ResourceID

having count(vrs.Name0)=1 )Sub

inner join v_Add_Remove_Programs arp1 on arp1.resourceid=sub.ResourceID

where arp1.DisplayName0 like 'Java%'

order by sub.name0,arp1.DisplayName0,arp1.Version0

You can use this query to create nice SSRS Report and prompt for specific application so you can get information for any application.

SCCM Configmgr identify count of Direct membership rules ,collection Schedule Refresh Types

$
0
0

Collections in Configmgr play a crucial role .If you want to do anything(can be software deployment,OSD ,Client agent settings,Software updates,compliance etc) in configmgr against clients,you a collection .

Being Configmgr administrator, it is always important to look at collection performance ,if they are scheduled well and do some maintenance like identifying collections that take longer time to update (collection evaluation viewer tool from Configmgr 2012 toolkit) or identifying the collections that update too frequently than expected etc.

This blog post will assist you to identify collections with count of direct membership rules and type of schedule and other important collection Queries which can be represented in Nice SSRS Report.

The below SQL Code is for Collections with count of Direct Membership rule and what type of Collection Schedule configured.

Usually for Collections with Direct membership rule, you really no need to configure any Schedule at all as they are one time created and do not require any update.

so ,you can simply run this SQL Code ,if the count of Direct membership rule is bigger and if any Schedule configured to get the RID of it.

Direct membership rule info stored in v_CollectionRuleDirect View ,For more information about SQL Views in Configmgr, refer this Excel spreadsheet

Schedule can be of anything listed below:

Scheduled
Incremental
Scheduled and Incremental

SQL Code:

select coll.CollectionName,crd.CollectionID,COUNT(crd.RuleName) [Direct rules],
Case when coll.RefreshType = 1 then 'Manual'
when coll.RefreshType = 2 then 'Scheduled'
when coll.RefreshType = 4 then 'Incremental'
when coll.RefreshType = 6 then 'Scheduled and Incremental'
else 'Unknown' end as RefreshType
from v_CollectionRuleDirect  CRD
inner join v_Collections Coll on CRD.collectionID=coll.SiteID
Group by crd.CollectionID,coll.RefreshType,coll.CollectionName
order by crd.CollectionID

SQL Code for All Collections with its Refresh Type:

Select (Case when RefreshType = 1 then 'Manual'
when RefreshType = 2 then 'Scheduled'
when RefreshType = 4 then 'Incremental'
when RefreshType = 6 then 'Scheduled and Incremental'
else 'Unknown' end) as RefreshType, count(SiteID) as Collections
from v_Collections
group by RefreshType

image

Download SCCM Configmgr 1602 SQL views documentation

$
0
0

 

Microsoft SQL Server view is a virtual table whose contents are based on the result from a SQL query. A view saved SQL Query which you can treat this as virtual table. A view consists of a set of named columns and rows of data. However, the contents of a view are not stored in the SQL database. The rows and columns of data come from tables or other SQL views referenced in the query that defines the view and are produced dynamically when the query is run. The query that defines the view can be from one or more tables or from other views in one or more databases.

When you install Configuration manager ,it creates lot of SQL views of following types:

  • Views against static (unchanging) tables.
  • Views that use data from tables with a dynamic (changing) schema.

For a dynamic schema, setup creates a number of SQL Server stored procedures that create the views. These stored procedures are run by Configuration Manager to refresh the views when the schema of underlying tables changes. Collection evaluation, discovery, and inventory data are examples of data for which new tables or new properties in existing tables might be created during the operation of a Configuration Manager site.

To create effective SSRS reports, you need to know the Configuration manager views available in SCCM Database to get the required data.

It is always helpful ,Handy and easy for you to write SSRS Reports ,if you know the value that you are looking (for ex: Network information) for is stored in which SQL view .

Through this blog post ,I would like to share the Excel spreadsheet that consists of Configuration manager 1602 (Current branch at the time of writing this blog post) views help you to identify the required information for your SSRS report.

I have also highlighted (Orange Color Background) the Views that are available only in 1602 but not in earlier versions (1511) of configuration manager so you know what’s new in 1602 current branch .

image

Due to the features/Updates added into Current Branch version 1602 ,the 4 interesting (atleast for me) SQL views added are listed below:

v_CollectionMemberClientBaselineStatus

v_CMConsoleUsageData

v_WindowsStoreForBusinessApps

vSMS_HealthAttestationDetails

I will write a another blog post explaining about these 2 newly added SQL views that really helps to find about SCCM Console usage and Client BaseLine Status.

Download the SQL View documentation for SCCM Configmgr 1602 from TechNet Gallery.

For Other Configmgr version, you can download the SQL Views from Configmgr 1511 , Configmgr 2012 R2 SP1, Configmgr 2012

References :

SQL Server Views in System Center 2012 Configuration Manager

How to Monitor Configuration manager Console Usage Data

$
0
0

With system Center Configuration manager Build Update 1602 (Current branch ) ,we can now monitor the Configuration manager console usage data .

In previous versions of configmgr ,there is no records in database to see who are the users connecting to SCCM console ,though this information is tracked in SMSProv.log, but no stored information for reporting.

Microsoft have made some improvements with Configmgr current branch build 1602 ,that store the information in database,WMI class about users who try to make successful connection .

After you install the Configmgr console update 1602 and try to connect to Site server (CAS or Primary Site) , if the user is having least permissions( RBA) , SMS provider start tracking the information by executing several queries against the permissions defined in RBA (like OS ,software updates,packages ,applications ,collections and many more )  ,all these information can be monitor in smsprov.log .

This process is same in earlier versions of Configuration manager but the change that was added to Build Update 1602 is ,it creates additional stored procedures,tables,views to store machine Name that is trying to connect to console ,User name ,connected site code , admin console Version (all this info appear in SMSProv.log) and other important information and insert into the database by executing stored procedure (spCMUpsertConsoleUsageData )that Update Console Telemetry table with admin console machine telemetry information.

I have installed Console (CB Configmgr 1602) in PC001 and tried to connect to my Site using APAC\Eswar who has permissions defined using RBA,monitor the log (smsprov.log) for more information:

couple of screenshots from SMSprov.log:

image

image

image

All the information coming from client and connecting to Site server will be tracked in the database.

So,where does the information stored in database and WMI about the console usage ?

In Database ,there is view called : v_CMConsoleUsageData ,which stores information about PC ,User who connect to console ,Connected Site ,Site number,What is OS Build of the Connected PC,Console Version Installed,Client Version installed, Memory,.net framework installed version ,Console connect time and other information.

SQL Query :  select * from v_CMConsoleUsageData

image

After executing the Query ,I have noticed that ,the console connected time is showing in UTC instead of client connected time (Local time) .

This leads me to review the code used in stored procedure and check if any conversion syntax used and Yes ,it is using syntax to convert : (ConsoleConnectTime = GETUTCDATE()) .

So,if you want to have the console connected time but not UTC,you can either change the stored procedure (HIGHLY NOT RECOMENDED) or use the SQL CAST DATE syntax function ,something like below:

select MachineName,UserName,ConsoleConnectTime [ConsoleConnectTime (UTC)],
CAST(GetDate() - GetUtcDate() + ConsoleConnectTime AS datetime) [ConsoleConnectTime]
from v_CMConsoleUsageData

image

Once you know,there is view exist that store the information ,you can start working on your customized report by joining other views and create Nice SSRS Report.

For more information about SQL views in Configmgr update 1602,refer this post

Report is okay but can I create collection (user device collection probably to see who are all users connecting to site ) ? if you are interested to play with this .

WMI class (for Collection) called: SMS_ConsoleUsageData (Instance: ROOT\SMS\site_sitecode)

For some reason, I had SMS_ConsoleUsageData class with empty information,though I can generate report for console usage data as you see in above snippet.

Run wbemtest from RUN command, connect to ROOT\SMS\Site_PS1 name space. Click on Query and run the following command to see if it returns any value:

select * from SMS_ConsoleUsageData

image

So ,How to get this corrected ? am still trying to figure out using the stored procedures ,which might help to update the information into WMI ,but no fix yet for me. Am not sure if this is happening to all or Only for me.

So 2 things are pending (at least for me) for confirmation from this post 1) UTC time for console connected time 2)WMI results empty .

I will update this post when I find something on this UTC and WMI class.

System Center Configuration Manager Reporting Unleashed Book – Easy way to get your Reports Done

$
0
0

I have been putting lot of SQL Queries ,SSRS Reports on my blog and I never explained ,how you can create such SSRS reports on your Own and I know that ,it is not easy to explain in blog post about the SQL/SSRS Reports . This is post will help you ,how to understand Configuration manager reporting and how to write your Own SSRS Reports (Advanced level) .

There are lot of books released on System Center Configuration Manager ,but there is nothing specifically for Reporting (in-depth).

The wait is Over now and Finally ,the only book that was missing since long on Configuration Manager Reporting is now available on the market I.e System Center Configuration Manager Reporting Unleashed.

This Book was written by Well known Configuration Manager MVP Garth Jones  and his export Co-authors Dan Toll and Kerrie Meyler .

The Unleashed book written by Experts is really fantastic and it has all the content what is needed for you to get complete knowledge on Configuration Reporting,RBA ,SQL views ,SSRS Report Builder and lot more.

You’ll walk through installing and configuring SSRS, using SQL views to find the data you need, writing SQL queries, creating basic and advanced reports, and using role-based administration to securely deliver those reports to the correct individuals.

image

Content at a Glance give you better feeling that ,it consists of of total 411 pages which is all about Reporting.

Contents at a Glance:

image

I highly recommend to purchase this book ,If you want to become expert in creating Custom based SSRS Reporting in Configuration manager and deliver the content to your management with in No-time .

You can purchase this book (System Center Configuration Manager Reporting Unleashed )from Amazon website ,available in both Paper back and Kindle version http://www.amazon.in/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=configuration+manager+reporting+unleashed

and from InformIT http://www.informit.com/store/system-center-configuration-manager-reporting-unleashed-9780672337789


SCCM Configmgr Software update Compliance Report for multiple Software Update groups per collection

$
0
0

 

Long ago ,did blog post on How to get software update compliance for specific update group per collection with drill down report to list the Required/missing ,unknown clients with some additional information like recent hardware inventory, last update scan results ,OS etc .

This report will only work for single software update group per collection ,but in Configuration Manager ,there could Multiple Software update group created as part of Patching process and it would be difficult to know the compliance status for the same collection for multiple update groups and this task become tedious if you run the same report multiple times and write down the results into file.

with the help of Configuration Manager console ,it is possible to see the Compliance % (Required, installed ,Unknown  and %) for the software update group for the deployed collection but if you want to see the same for multiple update groups and get the list of Required Clients etc ,not possible ,Thus you need SSRS Report.

Would it be nice to have SSRS Report that list the Software update compliance for multiple update groups per collection ?

This report is lying in my bucket for longer time and finally going out to public.

I have made little changes to the report (nothing major ) with respect to prompts (select multiple update groups) and drill down report changes as well.

This report allow you to select multiple Update groups and single collection as shown below . you need to action on Required(a.k.a Missing) and Unknown status.

It has 2 RDL files 1) Update compliance Status for multiple Groups per collection and 2) Linked report to know what are the client with specific Software update Status (Required ,Unknown)

First report looks like below:

Multiple Update Groups for Collection

Installed—>Specifies that the software update is applicable on the client computer and that the client computer already has the software update installed.

Not Required—>Specifies that the software update is not applicable on the client computer, and therefore, the software update is not required.

Required –>Specifies that the software update is applicable and required on the client computer

Unknown—> Specifies that the site server has not received a state message from the client computer,could be various reasons like scan did not run successfully,scan completed but state message did not sent successfully etc.

Click on the Arrow (blue color) to see the Required ,Unknown clients for the selected software update group:

Software Update Compliance Report

 

Download the Reports from TechNet Gallery ,Upload to your Configmgr SSRS reports ,Change the Data source and Run the Report .

How to troubleshoot software update issues ,refer http://eskonr.com/2015/04/sccm-2012-troubleshoot-client-software-update-issues/

SCCM Configmgr Get the Update Compliance Status for multiple Update groups against Multiple collections using SQL query without reporting

$
0
0

Recently ,we had an issue with SCCM Configmgr Reporting services role (Remote SQL sitting on VM was crashed ,blog post coming soon ) and we were unable to generate reports mainly for the Software update compliance status that happens every month. This post is about ,how to check the software update compliance status for the deployed software update group/Groups per collection/collections without using Configmgr Reports . The reason for posting this blog is ,fixing the Configmgr Reporting services role took more than expected time and meantime ,we need to check the status of patch compliance status and troubleshoot the non-compliant machines (servers) within the Maintenance window.

I thought the SQL Code which I used to generate the compliance status would be handy for others if they do not want to Use configmgr Reports and use SQL Code for Quick results.

If you are unable to generate compliance status using the SSRS Reports ,the only possible method is ,to depend on Monitoring node—deployments ,look for the software update deployment for particular collection and see the non-compliant machines for troubleshooting which is not easy method if you have large number of deployments and collections.

So ,to overcome this ,you can USE SQL management studio and run the query (posted below) to generate non-compliance list of clients with extra information like hardware inventory,software update scan,,Operating System ,IP address,User Name ,does it have Client etc.

This SQL Query should be helpful to quickly generate compliance Status for multiple software update groups and for multiple collections.

I recently posted a blog about ,how to generate software update compliance Status for multiple update groups per collection but this SQL query helps to generate update compliance status for multiple updates groups against multiple collections.

you can use this SQL query to create nice SSRS Report for multiple update groups per multiple collections in OneClick.

The below SQL code is for list of clients with required/Missing Status ,If you want clients with Unknown ,change the @status value to 0 ,More about Update compliance Status ,see below :

Update compliance Status:

0—Detection Status Unknown

1—Not Applicable

2—Required/Missing

3—Already Installed /Compliant

image

 

--SQL Code to Generate Update compliance Status for multiple update groups against multiple collections

Declare @Status nvarchar(255);set @Status='2';
--Status 0 for Unknown, 1 for Not Applicable,2 for Required ,3 for installed
select sys.name0 [Computer Name],sys.User_Name0 [User Name], os.caption0 [OS],
CONVERT(VARCHAR(26), ws.lasthwscan, 100) as [LastHWScan],
CONVERT(VARCHAR(26), uss.lastscantime, 100) AS 'LastSUScanTime',
CONVERT(VARCHAR(26), sys.last_logon_timestamp0, 100) AS 'Last Logon Time',
case when sys.client0='1' then 'Yes' else 'No'
end as 'Client (Yes/No)', c.IPAddress AS [IP Address]
From v_Update_ComplianceStatusAll UCS
left join v_r_system sys on ucs.resourceid=sys.resourceid
left join v_FullCollectionMembership fcm on sys.resourceid=fcm.resourceid
left join v_collection coll on coll.collectionid=fcm.collectionid
left join v_GS_OPERATING_SYSTEM os on ucs.resourceid=os.resourceid
left join v_gs_workstation_status ws on ucs.resourceid=ws.resourceid
left join v_updatescanstatus uss on ucs.ResourceId=uss.ResourceID
left join v_AuthListInfo LI on ucs.ci_id=li.ci_id
INNER JOIN (SELECT     IP1.resourceid AS rsid2, IPAddress = substring
((SELECT     (IP_Addresses0 + ', ')
FROM    v_RA_System_IPAddresses IP2
WHERE     IP2.IP_Addresses0 NOT LIKE '169%' AND IP2.IP_Addresses0 NOT LIKE '0.%' AND IP2.IP_Addresses0 NOT LIKE '%::%' AND
IP_Addresses0 NOT LIKE '192.%' AND IP1.resourceid = IP2.resourceid
ORDER BY resourceid FOR xml path('')), 1, 50000)
FROM    v_RA_System_IPAddresses IP1
GROUP BY resourceid) c ON c.rsid2 = ucs.resourceid
where li.title IN (SUG1’,'SUG2’,SUG3’) and coll.collectionID in ('PS10029A','PS10000D')and ucs.status=@Status
--'SUM_2000_2015_All','SUM_2016_June_All','SUNM_2016_june_all'
group by sys.name0,sys.User_Name0,os.Caption0,ws.LastHWScan ,uss.LastScanTime,sys.Last_Logon_Timestamp0,sys.client0,c.IPAddress
order by 1

Hope it helps !

Download SCCM Configmgr CB 1606 SQL views documentation

$
0
0

Microsoft released new version of SCCM Configmgr Current Branch 1606 (YY MM) with lot of new features and improvements to the existing features. You can install this update via in-console update.

With this new update ,there are also couple of newly added SQL views compared to its previous update (1602) which will help us to create reports in better way.

So ,what’s new in SCCM Configmgr CB 1606 SQL reporting ? Lets have a look at ,what are SQL views added newly and also have this SQL Views document handy for reporting ,otherwise , you may end up looking into the database for the correct information.

There are 3 SQL views added with this update version (1606) compared to its previous version 1602 ,listed below:

v_GS_ClientEvents
v_GS_OFFICE365PROPLUSCONFIGURATIONS
v_MDMDeviceCategory

Download the SQL View documentation for SCCM Configmgr Current Branch 1606 from TechNet Gallery.

For Other Configmgr version, you can download the SQL Views for Configmgr 1602Configmgr 1511 , Configmgr 2012 R2 SP1, Configmgr 2012

Recommended Reading :

SQL Server Views in System Center 2012 Configuration Manager

SCCM Configmgr SQL query to find Top X missing updates for specific collection for specific update group

$
0
0

Since few days ,I am working on a customized Software update compliance dashboard report with some Pie charts for management to see how the patch compliance progress for each Business Unit (I say business unit means for each country).

Management are interested to see the overall patch compliance summary for each country (focused on servers ) into a nice pie chart which can be published to them either Via emails (using SSRS subscriptions or put them on Bigger screens especially for server compliance status).

This dashboard uses lot of pre-existing reports that are already published on my blog ,but there is one report (though SQL query is few lines code) which makes me to spend lot time doing lot of changes and check in the console if the results tally or not and the report is:

Top 5 or 10 missing patches for specific collection and specific update group.

The hard part for getting this report work is ,identifying the correct views to join Software update group ,compliance status . I would strongly recommended to use the SQL views documentation to create any custom SCCM reports.

After going through the SQL view documentation ,found below views that will help me to join the software update group (CI_ID) and software updates (CI_ID)

v_BundledConfigurationItems –contains information about each Update CI_ID and software update group ID

v_AuthListInfo –Contains Software update group Name, Update ID(CI_ID) .

For reporting (ONLY) ,we normally have 1 software update group that contains list of all updates (as per the requirement from IT Security team as they are the ones who decide what security patches to deploy ) that are  deployed to clients from so long to until 2 months old from current month  . Technically speaking, you cannot have more than 1000 updates in software update group which you can deploy to collection but ,in this case ,it is only used for reporting ,I can have more than 1000+ updates into 1 software update group and always make sure this SUG group is at good compliance rate for each BU .

As we move on, add the previous months patches to this Software update group and rerun the report to reflect the status for newly added updates against each country collection.

In this blog post, I will share you couple of SQL queries which are used my dashboard report ,help you to create your own dashboards.

P.S: The reason for not posting the dashboard which I created is because ,it has lot of customizations (more into collection ID’s and Software update group) per country basis and they are unique for each organization ,but I can share how the output of the dashboard look like.

Each pie chart has linked report to see the list of clients status like missing or unknown for troubleshooting purpose.

image

Below are couple of SQL queries that I wanted to share with you guys.

1.How to get list of top 5 or 10 missing patches against particular collection for specific software update ?

In SCCM console ,if you go to software updates node ,you can see lot of information for each update with Bulletin ID,Title ID,required,installed etc , but there is no way for you to filter against particular collection and if you want see the list of clients that needed by the patch ,no way in the console.

You either have to use default reports (if there is any such) otherwise ,create custom report.

Use the below Query in your SSRS or SQL management studio to get list of all updates from particular software update group against collection with missing count.

Declare @CollID nvarchar (255),@SUG nvarchar(255);
Set @CollID='PS100254';set @SUG='SUM_2016_July_All';
--CollID=Collection ID and SUG=Software update group Name

Select CAST(DATEPART(yyyy,ui.DatePosted) AS varchar(255)) + '-' + RIGHT('0' + CAST(DATEPART(mm, ui.DatePosted) AS VARCHAR(255)), 2) AS MonthPosted,
ui.Title, ui.ArticleID, ui.BulletinID, ui.DateRevised,
case when ui.IsDeployed='1' then 'Yes' else 'No' end as 'Deployed',
SUM (CASE WHEN ucs.status=3 or ucs.status=1 then 1 ELSE 0 END ) as 'Installed/Not Required',
sum( case When ucs.status=2 Then 1 ELSE 0 END ) as 'Required'
From v_UpdateInfo ui
JOIN v_Update_ComplianceStatus ucs on ucs.CI_ID = ui.CI_ID --AND ui.IsExpired = 0 AND ui.IsSuperseded = 0
--If you want display the expired and superdeded patches, remove the -- line in the above query
JOIN v_BundledConfigurationItems bci on ui.CI_ID = bci.BundledCI_ID
JOIN v_FullCollectionMembership fcm on ucs.ResourceID = fcm.ResourceID
join v_R_System sys on sys.ResourceID=ucs.ResourceID
where bci.CI_ID = (SELECT CI_ID FROM v_AuthListInfo where title=@SUG)
and fcm.CollectionID
=@CollID
group by CAST(DATEPART(yyyy,ui.DatePosted) AS varchar(255)) + '-' + RIGHT('0' + CAST(DATEPART(mm, ui.DatePosted) AS VARCHAR(255)), 2),
ui.Title, ui.ArticleID, ui.BulletinID, ui.DateRevised, ui.IsDeployed
order by sum( case When ucs.status=2 Then 1 ELSE 0 END ) desc

If you compare the result you get from above SQL query ,the required count of clients will vary from what you see in the SCCM console software updates node and this is due the fact that ,in the console ,the software updates do not have any limitation over any collection(They apply to all clients) .But here ,we are trying to limit the software update against particular collection.

You can use this SQL query in multiple ways as you  need.For example ,if someone want to see the list of updates that are still needed by specific collection(BU) ,you can simply comment Software update group and choose only collection ,you can also do the other way.

To get top 5 or 10 missing updates ,simply use TOP 5 or TOP 10 . Full SQL Query is below:

Declare @CollID nvarchar (255),@SUG nvarchar(255);
Set @CollID='PS100254';set @SUG='SUM_2016_July_All';
--CollID=Collection ID and SUG=Software update group Name

Select top 5 CAST(DATEPART(yyyy,ui.DatePosted) AS varchar(255)) + '-' + RIGHT('0' + CAST(DATEPART(mm, ui.DatePosted) AS VARCHAR(255)), 2) AS MonthPosted,
ui.Title, ui.ArticleID, ui.BulletinID, ui.DateRevised,
case when ui.IsDeployed='1' then 'Yes' else 'No' end as 'Deployed',
--SUM (CASE WHEN ucs.status=3 or ucs.status=1 then 1 ELSE 0 END ) as 'Installed/Not Required',
sum( case When ucs.status=2 Then 1 ELSE 0 END ) as 'Required'
From v_UpdateInfo ui
JOIN v_Update_ComplianceStatus ucs on ucs.CI_ID = ui.CI_ID --AND ui.IsExpired = 0 AND ui.IsSuperseded = 0
--If you want display the expired and superdeded patches, remove the -- line in the above query
JOIN v_BundledConfigurationItems bci on ui.CI_ID = bci.BundledCI_ID
JOIN v_FullCollectionMembership fcm on ucs.ResourceID = fcm.ResourceID
join v_R_System sys on sys.ResourceID=ucs.ResourceID
where bci.CI_ID = (SELECT CI_ID FROM v_AuthListInfo where title=@SUG)
and fcm.CollectionID =@CollID
group by CAST(DATEPART(yyyy,ui.DatePosted) AS varchar(255)) + '-' + RIGHT('0' + CAST(DATEPART(mm, ui.DatePosted) AS VARCHAR(255)), 2),
ui.Title, ui.ArticleID, ui.BulletinID, ui.DateRevised, ui.IsDeployed
order by sum( case When ucs.status=2 Then 1 ELSE 0 END ) desc

Now that, we have count of all updates for specific update group for specific collection with required client count ,but how to get the list of clients needed need specific update ?

This is mainly needed if you want to create linked SSRS report to see the list of clients for specific update for troubleshooting purpose.

SQL Query to list the clients required by specific software update ?

 

Declare @CollID nvarchar (255),@SUG nvarchar(255),@title nvarchar(255);
Set @CollID='PS100254';set @SUG=''SUM_2016_July_All'';
set @title='Security Update for Windows Server 2008 R2 x64 Edition (KB2992611)'
--CollID=Collection ID , SUG=Software update group Name and Title= Name of Software update title

Select sys.Name0,sys.User_Name0,os.Caption0 [OS],ws.LastHWScan,uss.LastScanTime [Last SUScan],os.LastBootUpTime0
From v_UpdateInfo ui
JOIN v_Update_ComplianceStatus ucs on ucs.CI_ID = ui.CI_ID
JOIN v_BundledConfigurationItems bci on ui.CI_ID = bci.BundledCI_ID
JOIN v_FullCollectionMembership fcm on ucs.ResourceID = fcm.ResourceID
join v_R_System sys on sys.ResourceID=ucs.ResourceID
join v_GS_OPERATING_SYSTEM OS on os.ResourceID=ucs.ResourceID
join v_GS_WORKSTATION_STATUS WS on ws.ResourceID=ucs.ResourceID
right join v_UpdateScanStatus uss on uss.ResourceID=ucs.ResourceID
where bci.CI_ID = (SELECT CI_ID FROM v_AuthListInfo where title=@SUG)
and fcm.CollectionID =@CollID
AND UCS.Status='2'
and ui.Title=@title
group by
sys.Name0,sys.User_Name0,os.Caption0,ws.LastHWScan,os.LastBootUpTime0,uss.LastScanTime
order by 1

 

SQL Query used in Pie Chart to get the patch compliance status for specific Collection and for specific update group ?

select CASE WHEN ucs.status=3 or ucs.status=1  then 'success'
When ucs.status=2 Then 'Missing'
When ucs.status=0 Then 'Unknown' end as 'Status',ucs.status [Status ID],coll.CollectionID
From v_Update_ComplianceStatusAll UCS
    left join v_r_system sys on ucs.resourceid=sys.resourceid
    left join v_FullCollectionMembership fcm on ucs.resourceid=fcm.resourceid
    left join v_collection coll on coll.CollectionID=fcm.CollectionID
    left join v_GS_OPERATING_SYSTEM os on ucs.resourceid=os.resourceid
    left join v_gs_workstation_status ws on ucs.resourceid=ws.resourceid
    left join v_updatescanstatus uss on ucs.ResourceId=uss.ResourceID
    left join v_AuthListInfo LI on li.ci_id=ucs.ci_id
where li.title='Software update group name' and coll.CollectionID=’CollectionID’
and os.Caption0 not like '%2003%'
order by 1

Hope these SQL queries are helpful to you .

SCCM Configmgr Report for Count of MS Office Versions updated with list of clients

$
0
0

I wrote a blog post year ago on how to get count of MS Office Editions with versions installed across my environment using SCCM Configmgr. This report consists of 2 reports .1st report is ,to get count of Microsoft Editions for ex: how many are office 2003, 2007 ,2010 and 2013 and 2nd report is actually drilled report linked to 1st report to give list of all MS Office editions (what are the editions of office 2003 ,2007,2010 and 2013) with its client count .

Many of my blog viewers have requested through comments and some of them are via social networking sites ,that they want drill down the 2nd report to see the list of clients with each office edition and version.

Having drilled report to see the list of clients will certainly help to investigate and upgrade them to latest version of Microsoft office.

You can always create collection for office editions but having a report like this would help to export them to excel and other SSRS supported formats.

This request is pending from very long ,it was lying in my to-do list and finally going out through this blog post.

So what all you need to get this report (Count of MS office editions ) implemented in your SCCM site ?

Download the 3 reports from the TechNet Gallery ,upload the reports into your SSRS folder (make sure they all in same folder),change the data source for each report and you are good to run.

Note: This report will list only Microsoft Office 2003,2007,2010 and 2013 but not office 365. If you need office 365, you may have to wait for next update ,otherwise you can edit the RDL file and customize it.

How does the report look like ?

1. Count of MS Office editions

image

2. List MS Office editions for selected version (ex: 2003)

image

3. List of Clients by specific MS Office edition and version

image

 

Hope it helps.

Viewing all 98 articles
Browse latest View live