CCMEXEC.COM – System Center blog

CCMEXEC.COM – by Jörgen Nilsson

Did you know that you can multi-select topics in the Technet library and export it to a PDF in a very nice format, with table of content and chapters?It is extremely nice for viewing on a tablet on a plane for instance?

I found this nice little feature in the Technet Library which I didn’t have a clue that it was there, I am probably the last person noticing it but if you haven’t used it before you should try it out.

If you click on the Print/Export icon on the top right on Technet you can select the option “Print Multiple Topics”, then you will come to a help page which will help you get started.

printexport1

After that you will get a new bar with options, where you can select Add this topic

printexport2

If I select for instance news in System Center 2012 Configuration Manager what’s new i SP1 chapter and add it to the Server 2012 what is new I already selected before. And when you have added all the topics you want, Click on the “Collection” button.

printexport3

Then you will come to a page where you can see which topics you have selected and which format you want the export in either HTML or PDF

printexport4The end result is amazing! A PDF that you can read on the plane or wherever you like!
Thank you Microsoft Technet for a great feature!!

printexport5

I ran into this issue yesterday where my software updates where all of a sudden not downloaded anymore in the Configuration Manager Console. After applying the update KB2734608 which is required to support updates for Windows 8 / Server 2012, updates may need to be re-downloaded after applying the update.

See this blog post for more details:

Support Tip: Many new revisions of updates may be downloaded by the WSUS server

Yes!
Today two updates was released, one for Configuration Manager 2007 and one for Forefront Endpoint Protection 2010 both of them adds support for Windows 8 and Server 2012 as clients in Configuration Manager 2007 and Forefront Endpoint Protection 2010.
This is great news for customers which haven’t made the switch yet to Configuration Manager 2012 and Endpoint Protection 2012.

The update for Configuration Manager 2007 SP2 can be downloaded here: http://support.microsoft.com/kb/2750782

The update for Forefront Endpoint Protection 2010 update can be downloaded here: http://support.microsoft.com/kb/2758685

The article on the Configuration Manager team blog with more information can be found here: http://blogs.technet.com/b/configmgrteam/archive/2012/10/31/update-on-windows-8-and-windows-server-2012-support-in-cm-and-ep.aspx

Now it is time to implement these updates in my lab environment!

I needed a really simple script/solution to make sure that only tested/certified Computer models are being installed so I created this simple little script for it.

  • It will prompt the user that the computer model isn’t supported
  • Logs the make/model to a log file on a share
  • Fail the task sequence

To keep it simple I use the same query as in the  task sequence to deploy driver packages to sort out if the Computer model is supported by the task sequence. So you can simply copy the query from the Apply driver package step.

verify1

Then I use ServiceUI.exe from MDT 2012 together with a vbscript to prompt the user that the Computer model isn’t supported and write to a log file. ServiceUI.exe is simply brilliant as you can interact with the user from a Task Sequence! Fantastic!

verify3

The Show Dialog step looks like this:

verify5

The log file will contain the following information

verify4

Here is the VBscript, simply change the path to the log file and create the log file as well, the script will not create the log file if it doesn’t exits.

To implement it:

  • Create the group as described above in the Task Sequence
  • Create the WMI conditions
  • Download MDT 2012 to obtain ServiceUI.exe
  • Download the dialog.vbs file and rename it to Dialog.vbs
  • Change the path to the log file(make sure everyone has permissions to the share)
  • Create the text file used as log file.
  • Create  a package in ConfigMgr (no program necessary) with the two files ServiceUI.exe and Showdialog.vbs in the source directory.
  • Create a step to show the dialog, run it from the package created.

The script can also be downloaded here Dialog.vbs

‘Script to prompt the user that the computermodel is not supported and fail the task sequence
‘Written by jorgen @ ccmexec.com
‘log file to be used
strFile = “\\sccm02.demiranda.nu\pkgsource$\log\model.txt”
On Error Resume Next
Set objWMIService = GetObject(”winmgmts:\\.\root\cimv2″)
Set colItems = objWMIService.ExecQuery(”Select * from Win32_ComputerSystem”,,48)
For Each objItem in colItems
strManufacturer = objItem.Manufacturer
strModel = objItem.Model
Next
Set TsProgressUI = CreateObject(”Microsoft.SMS.TsProgressUI”)
TsProgressUI.CloseProgressDialog
‘Write log file
Const ForAppending = 8
set objFSO = CreateObject(”Scripting.FileSystemObject”)
set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)
objFile.WriteLine(”Time Stamp: ” & Now & ” Manufacturer = “& strManufacturer & ” Model = “& strmodel)
objFile.Close
MsgBox “This Computer model is not supported, the installation will be aborted.” &  chr(13) & “Please contact servicedesk for assistance”, 16,”Installation aborted!”
wscript.quit(1)


'Script to prompt the user that the computermodel is not supported and fail the task sequence

'ccmexec.com

'log file to be used

strFile = "\\sccm02.demiranda.nu\pkgsource$\log\model.txt"

On Error Resume Next

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)

For Each objItem in colItems

strManufacturer = objItem.Manufacturer

strModel = objItem.Model

Next

Set TsProgressUI = CreateObject("Microsoft.SMS.TsProgressUI")

TsProgressUI.CloseProgressDialog

'Write log file

Const ForAppending = 8

set objFSO = CreateObject("Scripting.FileSystemObject")

set objFile = objFSO.OpenTextFile(strFile, ForAppending, True)

objFile.WriteLine("Time Stamp: " & Now & " Manufacturer = "& strManufacturer & " Model = "& strmodel)

objFile.Close

MsgBox "This Computer model is not supported, the installation will be aborted." & chr(13) & "Please contact servicedesk for assistance", 16,"Installation aborted!"

wscript.quit(1)

Be sure not to miss the System Center User Group days in Stockholm Sweden on the 21-22 of January. The event will be two days, one day with focus on Datacenter and Private Cloud and one day will focus on Client Management.

I have the great honor of presenting on the Client Management track a session called “Advanced Application Management” :D

The event will host many great speakers like Wally Mead(Microsoft), Johan Arwidmark(MVP), Björn Axell(MVP), Robert Hedblom(MVP), Mikael Nyström(MVP), Anders Bengtsson(Microsoft), Jonny Andersson.

It will be a truly great event be sure not to miss it!!

Registration can be done here: http://www.scug.se/?p=125

All session will be in Swedish except from Wally’s sessions.

I hope to see you all there!

The Orchestrator integration in MDT 2012 Update 1 is my new toy for this week, it feels like Christmas when you where a little kid you want to play around with it all the time, have it next to the bed at night!

I wrote a blog post a couple of days ago on how to use the Orchestrator integration in MDT 2012 Update 1 to remove the computer from a Collection after a successful OS deployment.
I wrote in that post that you could use it to send an email if the deployment is not successful and it is just as simple. The end result will look like this, where we include the computername and as it is possible to pass variables on to Orchestrator we also use the setting for where the Log files are located for the failed OS deployment.

Orch2_4

Here is how to do it:

Environment prerequisites:

  • Configuration Manager 2012 site configured for OSD
  • MDT 2012 Update 1
  • The Network Access account need to have permissions to execute the Runbook

1. First we create a Runbook with two really simple steps.
Orch2_1 2. The initialize step has the following two variables:

Orch2_2

3. The Send Email step has the following settings in the text, it is necessary to configure SMTP server settings on the other tabs as well. To use the variables in the subject and message use right-click and select Subscribe / Published Data and select “OSDComputerName” in the list so the same in the Message box where we also include the path to the log file as well.

Orch2_5
4. In the SCCM 2012 MDT Task sequence we add a step in the end of the Task Sequence under the “Gather Logs and StateStore on Failure” with the following settings and again it is so easy, just type in the Orchestrator servername and you will be presented with a list of Runbooks to chose from. Chose the one we created and add the following variables to pass on to it.

Orch2_6Finished!

If you need to fail the task sequence for testing add a run command line running a vbscript with the following content, which will simply return an exit code of 1. Which indicates a failure.

Wscript.quit(1)

Next up create an incident in Service Manager if the OS deployment fails which is also really easy to do.

Start testing it yourself!

Today I got the MVP Award mail! It was a long day of waiting, checking the junk mail filter, checking that the mailbox wasn’t full and then finally the mail arrived. :D

“Dear Jorgen Nilsson,

Congratulations! We are pleased to present you with the 2012 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in System Center Configuration Manager technical communities during the past year.

Thank you Microsoft for presenting me with this award, it is a true honor! Thanks to all of you who inspired me with interesting scenarios and challenging questions!

/Jörgen

I finally got around testing the new Orchestrator Task in MDT 2012 Update 1 and wow is the word that comes into mind!

I thought well I will do two simple tests to see how it works, now I am hooked. I added two Orchestrator tasks in my OS Deployment Task Sequence the first step will remove the computer from the OSD Collection when it is completed and the other step will send an E-Mail if the OS deployment fails.

Two fairly simple tasks but think about the possibilities, updating the Service Request for re-installing a computer in Service Manager with status on where the installation is, adding a computer dynamically to a asset system or counting the number of time a computer is being re-installed which can be useful for seeing trends and identifying problems with models e.t.c.

Here is how to create a Runbook to remove the computer from a Collection after a successful OS deployment, which is something fairly often scripted today:

Environment prerequisites:

  • Configuration Manager 2012 site configured for OSD
  • MDT 2012 Update 1
  • The Network Access account need to be a Orchestrator User

1. In the Orchestrator Runbook designer I created a Runbook with the two following steps:

MDT_Orch22. Add a variable to the Initialize Data step like this:

MDT_Orch33. Create  a new step using the Delete Collection Rule activity from the System Center 2012 Configuration Manager Integration Pack. It defaults to “Direct” instead of “Direct Rule” so remember to change that. When creating the Membership rule right-click and select Subscribe / Published Data and select “Computername” in the list.

MDT_Orch44. Test the Runbook and Check it in after testing it successfully.

5.Create a new step in the SCCM/MDT Task Sequence like the one below, it is really simple type in the name if the Orchestrator server and press Browse then you will be able to browse all runbooks available on the Orchestrator server. The UI will find that the Runbook requires input, in this case in the form of Computername so you can select to pass a variable along.

MDT_Orch1That is it, incredibly easy!
You are now ready to test out your Runbook integration. Don’t forget to configure security in Orchestrator so you have permission to execute the Runbook

Here is a another example on how to use the Orchestrator integration from Peter van der Woude, which display how to move the computer to the correct OU after deployment, which is another popular thing to script. http://www.petervanderwoude.nl/post/using-the-power-of-orchestrator-to-move-a-computer-to-a-different-ou-via-configmgr-2012/

So now we can use Runbooks instead of doing a lot of scripting in our deployment solutions!! However when you want to do more advanced things you will need sooner or later write your own Powershell script to achieve this, so scripting is still needed don’t worry ;-)