Roger Zander at myITforum.com

Collection Query findings

Collection Queries can be created easily from the Configuration Manager Console without deep knowledge of WQL or SQL… But have you ever checked how long the Collection Evaluator requires to execute the Query ?

An example: the following Rule should get all Machines with a specific Software installed where the Software itself can be x86 or x64:

image

CollEval took 153s ( 2min 33s ) to evaluate the rule ( in an environment with ~15’000 Devices ).

The Problem with this Rule is that two big tables with a lot of records per device are joined.

In this case it would make sense to create two individual queries on the Collection, one for x86 and one for x64.  A Query that references only one of the two big tables takes about 2s in this environment. So for two queries you will end up in ~4s.

Another Option would be to use “Installed Software” instead of “Installed Applications” because “Installed Software” contains x86 and x64 Software in one Table:

image

this Rule took only 2s

“Installed Software” is not enabled by default, you have to enable this inventory class in the AssetIntelligence section.
If you want to have a single Query Rule for x86 and x64 “Installed Applications” then you can use  a sub-select statement:

image


select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.ResourceId in
(select  SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceId FROM SMS_G_System_ADD_REMOVE_PROGRAMS where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "SoftwareA") or SMS_R_System.ResourceId in (select  SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceId FROM SMS_G_System_ADD_REMOVE_PROGRAMS_64 where SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName = "SoftwareA")

This Query took also 2s

Conclusion:
There are many ways to get the Result, but the time that CollEval requires to execute a Query can vary (in the scenario here from 153s to 2s ).

Posted: Aug 27 2014, 02:49 PM by rzander | with no comments
Filed under:
Unattended ConfigMgr2012 Setup

How much effort do you need to setup a System Center Configuration Manager 2012 R2 Site…

It’s just one Command !!!

If you have Windows Management Framework 5.0, just enter “install-package cm12r2” or with chocolateycinst cm12r2

Prerequisites:
- Server 2012 R2 (Domain joined)
- .Net Framework 3.5.1 installed !!!
- Fast internet connection (it will download ~4GB of data)
- 3 hours (dependent of the internet connection)
- more than 10GB free Disk space on drive C:

What does it do:

The Package cm12r2 will install the following dependencies:
- cm12r2.iis (Installation and configuration of IIS and other required Windows Features )
- cm12r2.adk (download and installation of ADK8.1 with the features required for Cm12)
- cm12r2.sql2012 (download and install SQL Server 2012 SP2 EVAL)
- cm12r2.cm (download and installation of System Center Configuration Manager 2012 R2 EVAL)

At the end you should have a fully functional ConfigMgr2012 Site.

Note: All the sources are downloaded directly from Microsoft. The setup is for evaluation only, do not use this in a productive environment !!

Posted: Jul 04 2014, 11:27 AM by rzander | with no comments
Filed under: ,
MSI UpgradeCode as Detection Method in CM12

Configuration Manager 2012 has a built-in Wizard to use the MSI Product Code in the Detection Method but there is no option to check for the Upgrade Code of a Windows Installer Package. 

The Product Code is a GUID that “normally” changes with different versions or languages where the Upgrade Code identifies a Product across Languages and Versions. So it may be helpful (sometimes) to use the Upgrade Code in a Detection Method if it doesn’t matter what version or language is installed.

Product Code:  http://msdn.microsoft.com/en-us/library/aa370854(v=vs.85).aspx
Upgrade Code: http://msdn.microsoft.com/en-us/library/aa372375(v=vs.85).aspx

The Installed Upgrade Codes (x86 and x64) are stored in the Registry:

HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\
UpgradeCodes

But to make it more challenging, the Upgrade Codes are "scrambled" (no idea why !?), so you cannot just search for a key...

To "Scramble" your Code, just take the first 8 Characters and read it from right to left (reverse), then the same with the next 4 Characters , then again with 4 characters and for the rest always take 2 characters and reverse the content:

image

With PowerShell you can use the following example to get the "scrambled" key:

$UpgradeCode = '{35265AC6-8855-4970-9275-C1E3EDDB46F1}'

$code = @( 8, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2 )
$string = $UpgradeCode -creplace '[^0-F]'
$pos = 0
$result = '' 

#Decode
for($i=0; $i -le $code.Length ; $i++)
{ $arr = $string.substring($pos, $code[$i]) -split "";
[array]::Reverse($arr);
$result = $result +($arr -join '').replace(' ','');
$pos = $pos + $code[$i] }

$result

You can then use the resulting key to create a detection rule to measure if the key exists or you can use a custom script in the detection method to check if the Upgrade Code exists:

$UpgradeCode = '{35265AC6-8855-4970-9275-C1E3EDDB46F1}'

$code = @( 8, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2 )
$string = $UpgradeCode -creplace '[^0-F]'

#Decode
for($i=0; $i -le $code.Length ; $i++)
{ $arr = $string.substring($pos, $code[$i]) -split "";
[array]::Reverse($arr);
$result = $result +($arr -join '').replace(' ','');
$pos = $pos + $code[$i] }

#Test if key exists
if(Test-Path `
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\
UpgradeCodes\$result)
{ $true } else { $null }

Posted: Jun 24 2014, 04:02 PM by rzander | with no comments
Filed under: ,
Chocolatey Applications in Configuration Manager 2012

Do you want to pimp your Configuration Manager Application Catalog in your Demo or Lab Environment with some (~200) nice looking Applications…

image

… then download and import the ChocoApp application Archive and import it into Configuration Manager 2012.

The Applications are imported from the chocolatey.org Package-Repository. They use the Chocolatey command to download and install the applications. The Apps do not have any content because chocolatey will load the content directly over the Internet.


To make the Applications available in the Application Catalog, you have to create a deployment for these “ChocoApps”… This can be done by PowerShell or you can use “ChocoDeploy” to create a deployment to the “All Users and user Groups” Collection.

Just copy ChocoDeploy.exe and ChocoDeploy.exe.config to the “Microsoft Configuration Manager\AdminConsole\Bin” directory on the Site Server und start it from there.


Note: There is no warranty or Support, use at your own risk.

Posted: May 28 2014, 11:14 AM by rzander | with no comments
Filed under: ,
PowerShell scripts in Collection Commander

With the release of Collection Commander V1.0.0.6, PowerShell commands are now all stored as files in the “PSScripts” Directory next to the executable….
image

The PS1 Files can be moved into subfolders to have an organized structure of the files…

image

The PowerShell Command Console will load all the Files and Folders and generates a menu structure that is identical to the folder structure…

image

The latest version contains already a set of PowerShell examples but if you have some scripts to share, send me a note ore post the PS code on cmcollctr.codeplex.com.

Posted: Jan 31 2014, 03:52 PM by rzander | with no comments
Filed under: , ,
Monitor Inventory WMI Provider updated

The Project moved from Sourceforge to https://monitordetails.codeplex.com/.

The new version of the WMI Provider does now also report the

- diagonal Size (in inch)
- horizontal size (in cm)
- vertical size (in cm)

You can extend Configuration Manager 2012 Hardware Inventory to collect the WMI Class "Win32_MonitorDetails" ....

Posted: Jan 09 2014, 09:31 AM by rzander | with no comments
Filed under: , ,
Client Center for Configuration Manager stable release

Client Center for Configuration Manager is now available as stable release (version 1.0.0).

A Windows Installer setup is available for x64 and x86. There is also a browser based version that can be hosted on an internal IIS server.

Or you can use the Click-Once edition which will automatically updates to the latest version.

Note: .NET 4 and WinRM are required to use the tool.

Posted: Dec 23 2013, 12:33 PM by rzander | with no comments
Filed under: , ,
PowerShell to cleanup expired "Client Operations" tasks

Deleting old, unused Client Operations tasks in the Configuration Manager 2012 Console is a pain because you cannot delete multiple items; you have to delete one by one....

The following PowerShell Command will cleanup all expired "Client Operations" Tasks (Adminconsole node Monitoring\Client Operations).
Replace xxx with your SiteCode and run the command on the site server.

Get-WmiObject -namespace "root\sms\site_xxx" SMS_ClientOperationStatus -Filter IsExpired=1 | % { ([wmiclass]"root\sms\site_xxx:sms_ClientOperation").DeleteClientOperation($_.ID )  }

Posted: Nov 26 2013, 12:59 PM by rzander | with no comments
Filed under: ,
Stable release for Collection Commander

Collection Commander for Configuration Manager 2012 has now a stable Version (Build V1.0.0.3) which is available as WindowsInstaller (MSI) package.

Change log:
- MSI Setup
- UI Improved
- CM12 Console integration
- New Powershell code snippets
- Client Center Integration

If you miss some functions, please place a note on https://cmcollctr.codeplex.com/discussions (with the corresponding Powershell command if available).

Posted: Oct 15 2013, 07:54 PM by rzander | with no comments
Filed under: , , ,
Configure WinRM by using CM12 Settings Management

Configuring WinRM (Windows Remote management) over GPO is a common scenario, but what to do if your Systems are not member of a Domain ?….
Compliance Settings in Configuration Manager 2012 can monitor and remediate configurations; why not using this technology to track the WinRM settings on your systems.

I’ve prepared a Baseline that monitors and remediate some basic WinRM settings:
image

You can download the Baseline example here: WinRM Configuration.zip

Posted: Jun 21 2013, 03:41 PM by rzander | with no comments
Filed under:
Monitoring CM12 Prerequisites and IIS configurations

Is IIS on your CM12 Site Systems properly configured ? An easy way to monitor (and automatically fix) your settings is using the compliance settings management from Configuration Manager 2012…

Based on Prerequisites for Site System Roles , I’ve created a DCM Baseline example that monitors and fixes IIS configurations and missing Server features that are used on ConfigMgr2012 Site System Roles …

Configuration Matrix:

IIS_DCM

Note: This is just an example… do not enable auto remediation if you are not 100% sure what the CI’s are doing… !  Use at your own risk.

Download the DCM Baseline here: IIS Configuration for CM12.zip

Posted: May 13 2013, 01:35 PM by rzander | with no comments
Filed under:
Collection Commander for Configuration Manager 2012

A first beta of Collection Commander for Configuration Manager 2012 is now published on http://cmcollctr.codeplex.com. Collection Commander for CM12 is an extended version of the recently released Patch Monitoring Tool for CM12.

It does use the SCCM Client Center Automation Library (which requires WinRM) as core, but can also  run custom powershell commands against multiple systems. If you are missing some commands, please report your wishes on the project page.

Screenshot

Installing the CM12 Console Extension (right click option):
- run "CMCollCtr.exe /Install" to install the right click option

Usage:
- right click a Collection in CM12 and select "Collection Commander...", or copy and paste computernames on the tool.
- the tool will automatically ping all systems and check for pending reboot etc.
- select one or multiple rows and right click to get the option to "Run powershell code..."
- select a Powershell command from the template list or write your own command
- ... the Powershell result will be retunred to the "StatusMessage" column.


Have fun


Posted: Apr 29 2013, 04:15 PM by rzander | with no comments
Filed under: , , ,
SCCM Client Center 2.0.4.2 released

Thanks to Mark Whitte for reporting and fixing!!! some Issues on SCCM Client Center (the one for SCCM 2007).

Version 2.0.4.2 includes the following changes:

  • Bug: Slp doesn't clear after connecting to a computer/new computer
  • Bug: Getting services can be called multiple times.
  • Bug: Getting Execution history over Remote registry sometimes fails (seen with 127.0.0.1 connections)->Add more meaningful message to error showing that the RemoteRegistry Service needs to be running
  • Bug: The Show advertisement button should clear the lower detail pane
  • Bug: The Show execution history button should clear tool tip at start
  • Bug: When connection fails the connected button should not read connected (happens if a successful connection was previously established)
  • Bug: Show schedules is slow to start. Looks like the first time we check if 64bit it takes a long time to determine, subsequent checks are cached.
  • Feature Request: Can the about box show in the taskbar?
  • Feature Request: Add more columns to Process View
  • Feature Request: Make Process View filterable
  • Feature Request: Add branch distribution support

The MSI on http://sourceforge.net/projects/smsclictr/  is updated and includes the latest Version.

For existing Installations, an update can be downloaded from: http://smsclictr.sourceforge.net/update/


And a final Note: The CM12 Version is growing at http://sccmclictr.codeplex.com/... please place your feature requests (or vote on existing requests) and Issues on the project page.

Posted: Apr 18 2013, 08:50 PM by rzander | with no comments
Filed under: , ,
Multiple entries for TopConsoleUser

I have seen an Environment where the Table SYSTEM_CONSOLE_USAGE_DATA had multiple entries per device… with the result that the TopConsoleUser was an old,orphaned entry on some reports.

The following Query will return all affected Machines:

SELECT COUNT(*) as [Count], System_DISC.Netbios_Name0, SYSTEM_CONSOLE_USAGE_DATA.MachineID 
FROM SYSTEM_CONSOLE_USAGE_DATA INNER JOIN 
     System_DISC ON SYSTEM_CONSOLE_USAGE_DATA.MachineID = System_DISC.ItemKey 
GROUP BY System_DISC.Netbios_Name0, SYSTEM_CONSOLE_USAGE_DATA.MachineID 
HAVING COUNT(*) > 1 

A full Hardware Inventory cycle removed the duplicates. You can use Collection Commander to enforce a full HW Inventory on the affected clients…

Posted: Mar 21 2013, 12:03 PM by rzander | with no comments
Filed under:
Patch Monitoring Tool for CM12

I made this adhoc Tool to get a brief overview of the Patch-Status from a list of machines... You can right click selected rows to trigger some patch related actions:

Screenshot












Requirements:

- Tool must run as Admin and the Account must have Admin rights on the target devices
- WinRM must be enabled (run winrm /quickconfig)

Notes:

-          CMHealthMon.exe /install will install a CM12 Console Extension on Collections
-         
You can Copy/Paste List of Computernames
-         
SCCM2007 Agents are not supported !
-     WinRM allows out of the Box 5 concurrent connections, the Tool is using 4 concurrent connections. You may have to extend the MaxConcurrentUsers via GPO.

There is no support or warranty !

Download here


Posted: Feb 06 2013, 03:50 PM by rzander | with no comments
Filed under: ,
More Posts Next page »