ConfigMgr Console Client Activity

Problem

Client has reported a HW inventory. HW info is blank under ‘Client Activity’ in ConfigMgr console.

Reason

The stored procedure that updates that view runs once every 24 hours and hasn’t ran since the client submitted its inventory.

Fix

Wait, or run the stored procedure CH_SyncClientSummary using the SQL code listed below.


SQL Code

Get the client’s last inventory date.

Get the client’s HW inventory date from the v_CH_ClientSummary view. In this example, the HW inventory was blank.

Run the stored procedure to update the view. After the stored procedure has ran, we re-run the query above to get the client’s HW inventory date from the view.

Backup SSRS Reports

If you need to backup your SSRS reports you can download each report individually, or use PowerShell to backup all of them quickly.

The information in this post was taken from the following articles:
https://www.recastsoftware.com/resources/how-do-you-backup-all-of-your-custom-configmgr-reports/
and
http://www.sqlmusings.com/2011/03/28/how-to-download-all-your-ssrs-report-definitions-rdl-files-using-powershell/

The website that the Recast article referrers to is no longer available and is only accessible via the web archive link given in the article. This post is so the script is easily available for later use.

The script has been updated and is available on GitHub.

The script requires two parameters, the SSRS FQDN, and the directory save the reports to. If the directory doesn’t exist, the script will create it.

The script assumes that HTTPS has been enabled on the SSRS site. If HTTPS has not been enabled, the script will need to be modified to switch back to HTTPS.

A progress bar is used to show progress.

Report backup in progress.
Reports have been backed up to the location passed to the script.

Working with ConfigMgr folders

When working with ConfigMgr and PowerShell you’ll need to interact with folders.

  • Get folder
  • Create folder
  • Delete folder

Pre ConfigMgr 2111

The folder structure can be accessed using the site code as a PSDrive. For example, PS1:\.

Each workspace and node have different folder structures within them. To see the options use the command below.

The folder structure used in PowerShell doesn’t always match the folder structure in the console. Generally, the console shows the items using the plural of the word, while PowerShell uses the singular of the word. In the console it’s Applications, while in PowerShell it’s Application.

List folders

To list a folder use the following:

Create folder

To create a folder use the following:

Remove folder

To remove a folder use the following:

Post ConfigMgr 2111

ConfigMgr added four new cmdlets to deal with folders:

To be continued…

Creating collections based on boundary groups

Full disclosure, the script below is based on the script by Jonathan Lefebvre at System Center Dudes.

The script below will create a folder structure “Operational\Boundary Groups based collection”. If a collection already exists, a message is disabled on the screen, otherwise, the collection is created and move to the folder.

The goal of the changes is to make it so the script can be scheduled to run nightly or weekly. This makes the creation of collections based on boundaries no longer manual.

Results from the first run of the script.
New folder and collections created.
Results after running the script a second time.

Finding computers without a piece of software

Finding computers with a piece of software, say the Edge browser, is fairly easy with ConfigMgr. Simply create a collection that looks for the software in question and query SMS_G_System_INSTALLED_SOFTWARE.

Finding computers without a piece of software can be more difficult. The trick its to create a query that looks for computers that are NOT in the query that finds the software in question.

In the query above, we are saying give me all of the computers that are not in the results returned. So if the results returned contain a list of computers that have Edge installed, a computer not in that list would be a computer without Edge.

In order to create this query, you need to set the “Criterion Type” to SubSelected values. Then you can select the operator, which in this case is “is not in”, then either browse for or paste the subselect query.

It’s worth noting that people smarter than me recommend using ResourceId instead of NetBiosName.

Check application revision on client

Delete root\ccm namespace with PowerShell

Delete the root\ccm namespace on the local computer.

Delete the root\ccm namespace on a remote computer.

Clear SCCM Cache

Borrowed from https://sccm-zone.com/deleting-the-sccm-cache-the-right-way-3c1de8dc4b48

Using the PowerShell code below will clear the ConfigMgr cache the correct way.

Collection query for reporting

In order to add a collection prompt to a custom report you need to add an additional dataset to your report that queries for all available collections, includes the collection name and ID, and sorts the list by name.

Below an an example of the required code to retrieve all collections from ConfigMgr.

Below is the output from SSMS.

To use the query in a report you need to add a new dataset. In this example the dataset is called “AllCollections.”

Now we can add the collection query to the report and the main dataset.

In order to make a report utilize the collection query, we need to add the view v_FullCollectionMembership_Valid to the report and join it to v_R_System_valid on the ResourceID column.

Now we need to modify the main report query to take advantage of the ConfigMgr collections. This is accomplished by modifying the report to filter on a variable. You do this by checking the box next to the “CollectionID” column from v_FullCollectionMembership_Valid box.

Now we’re ready to add the filter. Under the “Filter” column in the “CollectionID” row, enter ‘=@CollID’ without the quotes.

Now when you run the query you’ll be prompted for a collection ID. In the screenshot, SMS00001, or All Systems, is used.

Results from the query.

SQL to retrieve all collections

Below is the SQL code needed to retrieve all of the collections from ConfigMgr. This is useful when creating custom reports that need to be scoped to a specific collection. The query below selects the CollectionName and CollectionID columns and sorts the CollectionName column alphabetically.

Results from the query on my test system.