CCMEXEC.COM – System Center blog

CCMEXEC.COM – by Jörgen Nilsson

The binaries are updated for System Center 2012 Configuration Manager SP1, you should download them again before installing, then you will not have to install the hotfix which solves an issue with client installation.

More information:

http://blogs.technet.com/b/gladiatormsft/archive/2013/01/26/you-may-need-to-re-download-configuration-manager-2012-and-endpoint-protection-2012-sp1-binaries.aspx

Service Pack 1 has been out there for a while with a lot of great new features! There are some things to think about when upgrading and existing Configuration Manager 2012 environment.I have tried to collect useful information here to make it easier for you to upgrade to Service Pack 1.

1. Read the “Planning to Upgrade System Center 2012 Configuration Manager” on Technet

2. Download the hotfix for SP1 which solves an issue deploying the Configuration Manager 2012 SP1 which you will need, the ConfigMgr client installation logs

Couldn’t verify     ‘C:\WINDOWS\ccmsetup\MicrosoftPolicyPlatformSetup.msi’ authenticode signature. Return code 0×800b0101” in the ccmsetup.log file. http://support.microsoft.com/kb/2801987

UPDATE 26/1 2013

If you download the SP1 media after the 25/1 then you don’t have to download and use the update above.

3. This article describes the upgrade process http://support.microsoft.com/kb/2801416

4. There is a great list at myITForum with knwon issues as well, which is updated with new information all the time “System Center 2012 SP1 Woes, Gotchas, and Workarounds” I recommend reading this list before upgrading!

There was a question on Technet forum a while ago, requesting a script to configure the “Automatically install or uninstall required software and restart the computer only outside of the specified business hours”. http://social.technet.microsoft.com/Forums/en-US/configmanagerapps/thread/08d2f8e9-feaf-4143-af56-7e97ef20267c/

Torsten Meringer, ConfigMgr MVP wrote a blog post and a script a while back on how to modify the Business Hours using a vbscript, it can be found here http://www.mssccmfaq.de/2012/03/26/software-center-business-hours-auslesen-setzen/

I used Torsten’s excellent script and modified it to change the “Automatically install or uninstall….” setting instead. I will post it here if anyone else need to configure that setting.

Automatically_install

Here is a script to check what the setting is:

Set objUX = GetObject("winmgmts:\\.\root\ccm\ClientSDK:CCM_ClientUXSettings")
Set GBH = objUX.ExecMethod_("GetAutoInstallRequiredSoftwaretoNonBusinessHours")
WScript.echo "Automatically install or uninstall required software and restart the computer only outside of the specified business hours : " & GBH.AutomaticallyInstallSoftware

Set objUX = GetObject("winmgmts:\\.\root\ccm\ClientSDK:CCM_ClientUXSettings")

Set GBH = objUX.ExecMethod_("GetAutoInstallRequiredSoftwaretoNonBusinessHours")

WScript.echo "Automatically install or uninstall required software and restart the computer only outside of the specified business hours : " & GBH.AutomaticallyInstallSoftware

Here is a script to enable the “Automatically install or uninstall required software and restart the computer only outside of the specified business hours” setting.

Set objUX = GetObject("winmgmts:\\.\root\ccm\ClientSDK:CCM_ClientUXSettings")

Set inParam = objUX.Methods_.Item("SetAutoInstallRequiredSoftwaretoNonBusinessHours").inParameters.SpawnInstance_()

inParam.AutomaticallyInstallSoftware = "True"

Set result = objUX.ExecMethod_("SetAutoInstallRequiredSoftwaretoNonBusinessHours", inParam)



Thanks to Torsten who wrote the original script!!

Here is a Holiday reading tip!

This book is a great book if you want to get started with Configuration Manager 2012! It is well written by experienced professionals (Brian Mason and Greg Ramsey both MVP’s) with tons of experience, with a focus on getting you started and explaining why you do the things you do.

Configuration Manager 2012 is a very complex product so it can be a real challenge the first time you start using it. I really like that each feature covered in the book is divided in “Getting ready”, “How to do it”, “How it Works”, it makes it much easier to get an understanding how it actually works.

You can check it out here: Microsoft System Center 2012 Configuration Manager: Administration Cookbook.

4941EN_Microsoft System Center Configuration Manager 2012 Administration Cookbook_cov

In some scenarios in Configuration Manager 2012 you want your packages, OS images, boot image and driver packages, well everything you use in a task sequence to be available on the package share so that we can use the option to access the content directly during OS deployment.
This of course takes up more disk space but makes the OS deployment a little bit faster.

Here is the setting in question:

packageshare1

I got a question today if you could script that setting, so after a little bit of WMI browsing I found the value that needs to changed, as I couldn’t find it in the SDK for Configuration Manager 2012, maybe I wasn’t looking hard enough.

However here is a code snippet that you can use together together with the example on MSDN on how to call an example snippet: http://msdn.microsoft.com/en-us/library/hh949053.aspx.

Sub ModifyPackageFlags(connection, existingPackageID)

' Define a constant with the hex value for USE_PKGSHARE.

CONST USE_PKGSHARE = "&H00000080"

' Get the specific advertisement instance to modify.

Set packageToModify = connection.Get("SMS_Package.PackageID='" & existingPackageID & "'")

' List the existing property values.

Wscript.Echo " "

Wscript.Echo "Values before change: "

Wscript.Echo "--------------------- "

Wscript.Echo "Package Name: " & packageToModify.Name

Wscript.Echo "Package Flags: " & packageToModify.PkgFlags

' Set the new property value.

packageToModify.PkgFlags = packageToModify.PkgFlags OR USE_PKGSHARE

' Save the advertisement.

packageToModify.Put_

' Output the new property values.

Wscript.Echo " "

Wscript.Echo "Values after change: "

Wscript.Echo "--------------------- "

Wscript.Echo "Package Name: " & packageToModify.Name

Wscript.Echo "Package Flags: " & packageToModify.PkgFlags

End Sub

Sometimes an OS deployment fails for different reasons, one thing that can be a problem is that users in some cases don’t see the error message saying that the installation failed and starts using the computer. Even if we use “SMSTSErrorDialogTimeout” to change the default 15 minutes error dialog to 22 hours, the installation can be initiated over a weekend for instance.
If the installation fails near the end of the Task Seqeunce it could only be one application missing an nobody notice it.

I have written two small scripts for this, one that actually disables the computer account in AD if the TS fails and one that changes the logon background in Windows 7 to an awful looking background which cannot be missed by the user, of course this is just a sample.
If the Task Seqeunce fails it would look like this if the user tries to logon:

DisableComputer

Then no user cannot use the computer for sure.
I use it in an MDT task sequence so I put the two additional steps in the section “Gather Logs and StateStore on Failure” which is executed in case of a Task Sequence failure.

Here is how to implement it:

  1. Download the scripts needed here: TSerrorscript
  2. Place them in a folder that can be used as source folder as below.
    DisableComputer4
  3. In the backgrounds directory replace my ugly example logon background with your own.
  4. Create a package in Configuration Manager with the folder with the scripts as source folder and distribute it to your DP’s.
  5. In the Task Seqeunce add a step for disabling the computer account. I use the same account as I use to join the domain.
    DisableComputer5
  6. Set a condition to only run if not in WinPe as there is no account to disable if the computer is not in AD.
    DisableComputer6
  7. Then we add a step to change the background and use the same condition as above for this step.
    DisableComputer7That is it, now you are ready to test it out.

The recording from our System Center User Group Livemeeting, “System Center 2012 Configuration Manager – Tips & tricks”  is now live on Youtube!
The recording is in Swedish.

Livemeeting

http://www.youtube.com/watch?v=HaEVZ08E-z0&feature=plcp

I wrote post a long time ago on how to modify the builtin reports in Configuration Manager 2007 to display serial numbers for Lenovo computers as well as they are not stored in the same WMI class, http://ccmexec.com/2010/04/lenovo-computers-and-serial-numbers-in-reports/

Per request here is how to do the same in Configuration Manager 2012 for the report “Hardware 01A – Summary of computers in a specific collection”

Hardware 1a_1

  1. Launch the Admin Console with elevated priviliges, Right Click and select “Run As Administrator”
  2. Right-click on the report called “Hardware 01A – Summary of computers in a specific collection” and select “Edit”
  3. Report Builder will then be launched, depending on which SQL Version you use it will be either 2.0 or 3.0. If you are using SQL Server 2008 R2 you should edit the registry before so that the console can launch the correct version of the Report Builder, more information can be found here:
  4. Double-Click on Dataset0
  5. In the Query add /change the following lines displayed in red below:

select  distinct

v_R_System_Valid.ResourceID,

v_R_System_Valid.Netbios_Name0 AS [Computer Name],

v_R_System_Valid.Resource_Domain_OR_Workgr0 AS [Domain/Workgroup],

v_Site.SiteName as [SMS Site Name],

[Top Console User] = CASE

when (v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.TopConsoleUser0 is NULL or v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.TopConsoleUser0 = ‘-1′)

then @UnknownLoc

Else v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.TopConsoleUser0

End,

v_GS_OPERATING_SYSTEM.Caption0 AS [Operating System],

v_GS_OPERATING_SYSTEM.CSDVersion0 AS [Service Pack Level],

v_GS_PC_BIOS.SerialNumber0 AS [Serial Number],

v_GS_SYSTEM_ENCLOSURE_UNIQUE.SMBIOSAssetTag0 AS [Asset Tag],

v_GS_COMPUTER_SYSTEM.Manufacturer0 AS [Manufacturer],

v_GS_COMPUTER_SYSTEM.Model0 AS [Model],

v_GS_X86_PC_MEMORY.TotalPhysicalMemory0 AS [Memory (KBytes)],

v_GS_PROCESSOR.NormSpeed0 AS [Processor (GHz)],

(Select sum(Size0)

from v_GS_LOGICAL_DISK inner join v_FullCollectionMembership on (v_FullCollectionMembership.ResourceID = v_GS_LOGICAL_DISK.ResourceID )

where v_GS_LOGICAL_DISK.ResourceID =v_R_System_Valid.ResourceID and

v_FullCollectionMembership.CollectionID = @CollectionID) As [Disk Space (MB)],

(Select sum(v_GS_LOGICAL_DISK.FreeSpace0)

from v_GS_LOGICAL_DISK inner join v_FullCollectionMembership on (v_FullCollectionMembership.ResourceID = v_GS_LOGICAL_DISK.ResourceID )

where v_GS_LOGICAL_DISK.ResourceID =v_R_System_Valid.ResourceID and v_FullCollectionMembership.CollectionID = @CollectionID) As [Free Disk Space (MB)]

from v_R_System_Valid

inner join v_GS_OPERATING_SYSTEM on (v_GS_OPERATING_SYSTEM.ResourceID = v_R_System_Valid.ResourceID)

left join v_GS_SYSTEM_ENCLOSURE_UNIQUE on (v_GS_SYSTEM_ENCLOSURE_UNIQUE.ResourceID = v_R_System_Valid.ResourceID)

LEFT join v_GS_COMPUTER_SYSTEM on (v_GS_COMPUTER_SYSTEM.ResourceID = v_R_System_Valid.ResourceID)

inner join v_GS_PC_BIOS on (v_GS_PC_BIOS.ResourceID = v_R_System_Valid.ResourceID)

LEFT join v_GS_X86_PC_MEMORY on (v_GS_X86_PC_MEMORY.ResourceID = v_R_System_Valid.ResourceID)

LEFT join v_GS_PROCESSOR on (v_GS_PROCESSOR.ResourceID = v_R_System_Valid.ResourceID)

inner join v_FullCollectionMembership on (v_FullCollectionMembership.ResourceID = v_R_System_Valid.ResourceID)

left  join v_Site on (v_FullCollectionMembership.SiteCode = v_Site.SiteCode)

LEFT join v_GS_LOGICAL_DISK on (v_GS_LOGICAL_DISK.ResourceID = v_R_System_Valid.ResourceID) and v_GS_LOGICAL_DISK.DeviceID0=SUBSTRING(v_GS_OPERATING_SYSTEM.WindowsDirectory0,1,2)

left join v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP on (v_GS_SYSTEM_CONSOLE_USAGE_MAXGROUP.ResourceID = v_R_System_Valid.ResourceID)

Where v_FullCollectionMembership.CollectionID = @CollectionID

Order by v_R_System_Valid.Netbios_Name0

6. Click OK and then save the report, you could save it as a new report as well if you like to have the original query left

7. The report will now show the serial number for all computers including Lenovo

Hardware 1a_2