Roger Zander at myITforum.com

SCCM2012 ClientSDK Namespace

CM2012 Provides a ClientSDK WMI Namespace (root\ccm\clientsdk) to interact with the SCCM2012 Agent. The following Diagram shows all Classes and Methods of that Namespace (it’s from the Beta2 of CM2012)

ClientSDK

Full_Image

Posted: Nov 07 2011, 08:04 PM by rzander | with no comments
Filed under: , ,
offline installation Tool for App-V

Just released a new Tool to install App-V packages from USB, local Disks or UNC Path:

http://appvimport.codeplex.com/

Have fun…

Posted: Sep 21 2011, 09:08 PM by rzander | with no comments
Filed under: , ,
SCCM In-place migration with encrypted disks

Note!: The following content was provided from my Colleagues Armin Denzler and Markus Stucki. Thanks these guys to share the knowledge of their work.


Warning, use at your own Risk!


The final WinPE boot image may contain a mechanism to format the partition(s) on the local drive before SCCM Task Sequence logic comes up. Thus, simply booting from this image could cause loss of data!

The following Solution may not be supported by Microsoft.


Problem

In-place migration of Systems with encrypted Disks is out-of-the box not possible with SCCM2007 Task-Sequences. This is because the Task-Sequence has to boot into WinPE to apply the new Operating System but WinPE will not be able to read the Task-Sequence Environment from the encrypted Disk.

Booting WinPE from DVD or USB is not a Problem, because WinPE will initially load the TS-Environment from the Boot-Media and does not touch the encrypted disk.

Now, the Question with an in-place migration scenario is: how to boot into WinPE from the encrypted Disk, but let WinPE assume that it was started from a standalone media…

Solution

The following chapters describe a solution to adopt this workflow by creating a highly customized WinPE boot image (WinPE 3.0, version 6.1.7600). This solution, which was found in teamwork by Armin Denzler and Markus Stucki, might not be supported by Microsoft :-).

The Solution requires two Task-Sequences with two different Boot-Images assigned to the target Computer.

image

Task-Sequence #1 is defined to run only on the installed OS (specify the platform requirements on the TS to run only on the specified platform like “All x86 Windows XP”). This TS can be used to backup local data to a Network-Share.

Task-Sequence #2 is defined to be “available to boot media and PXE” (Advertisement Option) and it must only run from WinPE (You can limit the platform requirements to an unused OS like “x64 Windows XP Professional SP1”).

You may also have to define some conditions in the TS to prevent running the TS on the wrong OS.

TS#2 needs the standard Boot-Image that also is used with DVD/PXE boot.

TS#1 needs a modified Boot-Image that format the encrypted Disk (Dangerous!) and copy the TS Environment from WinPE#2 to the local empty disk.

As a Result, WinPE#1 does look for SCCM like WinPE#2 from a Boot-Media or PXE and the assigned TS#2 will start.

Note:
In general, it would also be possible to use this solution for just prestaging the modified boot image on target computers but preferably, SCCM R3 feature "Prestaged Media Provisioning" should be used.
If necessary, 802.1x Network Authentication may also be included, see
http://myitforum.com/cs2/blogs/lakey81/archive/2011/07/06/configuring-802-1x-network-authentication-for-winpe-3-0-and-configmgr-deployments.aspx.

Technical Details

The following difficulties are to be solved:

A) Per design, SCCM Task Sequence Engine checks where WinPE is booted from (PXE / Removable Media / Local Disk) and sets variable %CONFIGPATH% accordingly.

If WinPE was booted from a local disk, SCCM expects that the WinPE boot was initiated by a previously started TS and tries to read current status from local disk.

Details:

a. file ".\sms\bin\x64\TsBootShell.ini" refers to variable %CONFIGPATH%

b. %CONFIGPATH% specifies where the TS environment is located (à VARIABLES.DAT)

c. if WinPE is booted from

- CD/DVD:
SCCM sets %CONFIGPATH% to "<CD-drive-letter>:\"
SCCM automatically contacts the SCCM MP to check for assigned Task Sequences.

- PXE:
SCCM sets %CONFIGPATH% to "X:\sms\data\"
SCCM automatically contacts the SCCM MP to check for assigned Task Sequences.

- Local Disk,
SCCM sets %CONFIGPATH% to "<local-HD-drive-letter>:\_SMSTaskSequence"
This implies that a TS is already running and SCCM TS Engine tries to read status from local disk

This means that if SCCM TS Engine shall "forget" that there is a TS in progress (even if WinPE was booted from local disk), the path to configuration data must be manipulated in TsBootShell.ini not to point to a location on local disk:

- If the disk is NOT encrypted, SCCM TS Engine can access the files and finds that a Task Sequence is in progress (the TS which was started in full OS) and continues the TS (even if reboot to WinPE is the last step, TS resumes just to finish)

- If the disk IS encrypted, SCCM TS Engine cannot access files on local disk and fails

The solution is to

I) inject the TS environment information from an SCCM Bootable Media (complete content of folder .\SMS\DATA) into the boot image

II) modify ".\sms\bin\x64\TsBootShell.ini" in the boot image to point to a fixed path in RAMDRIVE X: rather than using the variable (/configpath:X:\sms\DATA instead of /configpath:%CONFIGPATH% )

B) When a boot image is added to SCCM (via console), it is modified and amongst other changes, the modified file ".\sms\bin\x64\TsBootShell.ini" is overwritten (SCCM defaults).

The solution is to

I) Mount the boot image and copy the required information (modified TsBootShell.ini and content of folder .\SMS\DATA from SCCM Boot Media) to a custom folder

II) Modify the WinPE startup process to copy the customized data from the custom folder to the according SCCM folders before the SCCM TS Engine is started:

- Per WinPE / SCCM default, TsBootShell.exe is called by winpeshl.exe as defined in winpeshl.ini.

- This process can be changed via modification of registry key HKLM\SYSTEM\Setup\CmdLine

Instead of directly calling winpeshl.exe, a batch file is called which performs the necessary copy actions and calls winpeshl.exe afterwards.

For more information, see http://technet.microsoft.com/en-us/library/dd744556(WS.10).aspx

C) When the SCCM TS Engine is started in WinPE (PE booted from local disk), it checks for a specific file in the root of the drive where boot.wim is located. File name is identical in each environment: "_SMSTSVolumeID.7159644d-f741-45d5-ab29-0ad8aa4771ca"
If the disk is encrypted, SCCM Task Sequence is unable to read this file and fails with error "Unable to read task sequence configuration disk".

The solution is to

I) Capture this file by starting a Task Sequence which just contains the instruction "Restart Computer" to "The boot image assigned to this task sequence" (with a long time out to reboot, this allows copying the file before the shutdown is initiated).

II) Place this file in the custom folder in the boot image

III) Format the local disk and copy the file to the root of the partition on local disk before the SCCM TS Engine is started

D) When a TS starts in WinPE, it checks the ID of the boot image which is associated to the task sequence.

As the customized boot image contains the environment (VARIABLES.DAT) which was obtained from a default SCCM Boot Media, it "inherits" the "BootpackageID" (which is the ID of the boot image that was selected in the "Task Sequence Media Wizard").

This leads to a discrepancy between the Image ID which is registered in SCCM and the Image ID stored in the image itself (it can be considered it as a mismatch between "internal" and "external" ID).

This means that the customized boot image cannot be assigned to an OS task sequence because it would result in a reboot loop:

SCCM checks if the currently running WinPE matches the assigned boot image ID. As the internal ID does not match, TS Engine loads the boot image with the according external ID again.

The solution is to use two different task sequences:

1) First Task Sequence is started in full OS to perform some actions like backing up data to the network followed by the step "Restart Computer" (to "The boot image assigned to this task sequence").

2) Second Task Sequence is a mandatory OS Task Sequence (associated with a "normal" boot image).

When WinPE is started from the modified boot image on local disk, SCCM will behave like being booted from a DVD/USB boot media and contact the MP and start execution of the assigned OS Task Sequence.

Step by Step

The following steps show how to create a customized x64 WinPE boot image (WinPE 3.0, version 6.1.7600) which allows booting WinPE from local disk but nevertheless start a task sequence from network:

1) Create a Task Sequence Media (Bootable Media à CD/DVD Set)

2) Extract ISO generated in step 1, make a copy of folder <extracted-iso-folder>\SMS\DATA

3) mount the boot image which will be associated with the task sequence

E.g.:
dism /mount-wim /wimfile:"C:\SCCM\BootMedia\boot-WinPE-from-HD.wim" /index:1 /mountdir:"C:\Temp\WimMountBootWim"

4) In the "root" of the mounted WIM (parameter "MountDir" in dism command),

a. create a folder named "CustomBoot"

b. copy complete DATA folder from step 2) to "CustomBoot"

c. if necessary, edit file TSMBOOTSTRAP.INI to set "Unattended=TRUE"

d. in folder "CustomBoot" create file "TsBootShell.ini" with the following content:

[Shell]
OrgName=
EnableDebugShell=true
Run=X:\sms\bin\x64\TsmBootstrap.exe /env:WinPE /configpath:X:\sms\DATA

e. if disk encryption is in place:

i. Create a task sequence which contains the step "Restart Computer" to "The boot image assigned to this task sequence". Set a long timer for reboot, e.g. 600 seconds.

ii. Advertise the TS to a test machine

iii. When the boot image is staged on the local disk and the reboot countdown begins, file "_SMSTSVolumeID.7159644d-f741-45d5-ab29-0ad8aa4771ca" should exist in the root of %SystemDrive%.

iv. copy the file to a temporary network location and add it to folder "CustomBoot" in the mounted boot image

5) Modify registry

a. load hive SYSTEM from "<mountdir>\Windows\System32\Config\SYSTEM"):

[HKEY_LOCAL_MACHINE\_WinPE-Reg-SYSTEM\Setup]
"CmdLine"="CustomStart.cmd"

b. unload hive

6) Create the file "<mountdir>\windows\system32\CustomStart.cmd" with the following content:

copy /y x:\CustomBoot\TsBootShell.ini x:\sms\bin\x64\*.*
xcopy /e /i /y x:\CustomBoot\DATA x:\sms\DATA
winpeshl.exe

If the disk is encrypted, a few more commands need to be added to CustomStart.cmd.
Additionally required actions are

- format the partition(s)

- copy file _SMSTSVolumeID... to the root of the drive where WinPE was bootet from (SCCM TS Engine expects this file to be located there), for example drive "C:"

copy /y x:\CustomBoot\TsBootShell.ini x:\sms\bin\x64\*.*
xcopy /e /i /y x:\CustomBoot\DATA x:\sms\DATA
format c: /q /v:tmpname /y
copy x:\CustomBoot\_SMSTSVolumeID.7159644d-f741-45d5-ab29-0ad8aa4771ca c:\
winpeshl.exe

7) unmount the WIM and use dism parameter "/commit", add boot image to SCCM and/or update Distribution Points

8) Associate the customized WIM image with a task sequence which is started in full OS, then create an advertisement for this TS.

9) Create a 2nd task sequence for OS deployment and create a mandatory advertisement.


Download PDF

Posted: Sep 16 2011, 10:42 AM by rzander | with no comments
Filed under: , ,
SCCM Client Center 2.0.4 released

Version 2.0.4 of the SCCM Client Center Tools is available for download at http://sourceforge.net/projects/smsclictr/.

Changes (since Version 2.0.3):

  • User based Advertisements (by Mark Whittle) 
  • SCCM2007 R3 Power management features (by Matthias Benninge)
  • List free Disk-Space and Username on Cached Packages
  • More detailed Information on running executions (by Mark Whittle)
  • Show Task-Sequence Advertisements with different Icon and Color (light green)
  • Show Service Window from enforce GMT Time zone on a different color (orange)
  • Enforce Update Scan if action is triggered more than once.
  • Evaluate single DCM Baselines 
  • AutoSiteAssignment and Policy reset will remove all pending site assignments
  • Fixed Issue on Policy import for Programs with dependencies
  • Ability to filter (hide) advertisements (by Matthias Benninge)
  • Dell Warranty Plugin (by Matthias Benninge)
  • Minor fixes and updates…

Note: There will be no SCUP Catalog Entry (http://smsclictr.sourceforge.net/update) for this Major Update.

Summary:
SCCM Client Center was download 90’400 times (from the Project Page), SMS Client Center was downloaded 34'528 times… And totally 6 Users have donated.

Posted: Jun 03 2011, 04:51 PM by rzander | with 1 comment(s)
Filed under: , ,
SCUP 2011 with shared Database

SCUP 2011 does per default work with a Microsoft SQL Server Compact (SQL CE) that stores all information's in the users Profile.

To share the published updates with other users, it may be necessary to change to default path where the database (scupdb.sdf File) is stored.  The path can be configured in the Scup2011.exe.config File located in the installation Directory of SCUP2011.

%SCUP Install Directory%\Scup2011.exe.config:

<applicationSettings>
    <Scup.Properties.Settings>
        <setting name="SSCEDataFile" serializeAs="String">
            <value>F:\SCUP2011\5.00.1727.0000\scupdb.sdf</value>
        </setting>
    </Scup.Properties.Settings>
</applicationSettings>

Posted: May 30 2011, 02:40 PM by rzander | with no comments
Filed under:
SCCM Packages containing a “web.config” file will not download from W2k8R2 BITS enabled DP

SCCM Agents are unable to download a Package from a BITS enabled DP running on Windows2008 R2 that contains a “Web.config” File.

Options to solve the issue:

#1) Change the Managed Pipeline Mode of the Application Pool “SMS Distribution Points Pool” to “classic”.

#2) Edit the ApplicationHost.config file and add the attribute enableConfigurationOverride="false" on the “SMS Distribution Points Pool” Application-Pool:

<system.applicationHost>


<applicationPools>

<add name="DefaultAppPool" />
<add name="Classic .NET AppPool" managedPipelineMode="Classic" />
<add name="SMS Distribution Points Pool" autoStart="true" managedPipelineMode="Integrated" enableConfigurationOverride="false" />

<applicationPoolDefaults>

<processModel identityType="ApplicationPoolIdentity" />

</applicationPoolDefaults>

</applicationPools>

Note: No warranty on any side effects of these changes Smile

Posted: May 09 2011, 10:39 PM by rzander | with 2 comment(s)
Filed under:
SCCM 2012 COM Automation Objects from remote PS Session…

The COM Automation objects from the SCCM2012 Agent can now be triggered from a remote PowerShell session… (this was not possible with SCCM2007 !)

An Example to get the assigned Site-Code:

Enter-PSSession –computername TargetComputer
$a = New-Object –comobject "Microsoft.SMS.Client"
$a.GetAssignedSite()
Exit-PSSession

Have fun…

Posted: Apr 18 2011, 04:58 PM by rzander | with no comments
Filed under: ,
SCCM Client Center Integration Pack for Opalis

Most of the Functions from SCCM Client Center can now be used in System Center Opalis Workflows.

Check Out the latest Version of the free SCCM Client Center IP for Opalis: http://sccmclictropalis.codeplex.com/

An Example of a “simple” Patch-Management Workflow to enforce the deployment of security updates on a machine:

Opalis

The following functions are currently available:

  • Trigger Agent Actions
    • HW Inventory
    • SW Inventory
    • Heartbeat
    • Collect Files
    • Machine Policy
    • User Policy
    • MSI Source Update
    • DCM Scan
    • Metering Scan
    • OOB Discovery
    • Certificate Maintenance
    • Location Refresh
    • Refresh MP
    • Timeout Requests
    • Reset Policy
    • Reset paused SWDist
    • Delete orphaned cached packages
    • Delete all cached packages
    • Delete cached updates
  • Get/Set Agent Properties
    • Site Code
    • HTTP Port
    • Management Point
    • Server Locator Point
    • Internet MP
    • DNS Suffix
    • Cache Size
    • Agent Version
  • Scan for Security Updates
  • Deploy authorized Security Updates
  • Detect and list missing authorized security updates
  • Report pending reboot
  • Reporting pending file operations for next reboot
  • Create/Delete SCCM Service Window (local Policy)
  • Create DDR File to create Computer Object
  • Check if Advertisement requires Reboot
  • Check for running Advertisements
  • Check for running downloads
  • Create/Calculate Dates that reference to the 2nd Tuesday like first Saturday after 2nd Tuesday.
  • WakeOnLAN
Posted: Mar 23 2011, 09:21 PM by rzander | with no comments
Filed under: , , , ,
SCCM Client Center Automation Library now on Codeplex

The .Net Library (smsclictr.automation.dll) from SCCM Client Center is now published on Codeplex.com <http://sccmclictrlib.codeplex.com/>

The source code for the library was published before as part of the Client Center Project at Sourceforge.org.

The Library contains most of the functions of Client Center and Collection Commander and can be used for custom programs or PowerShell scripts.

Client Center Update 2.0.3.3

SCCM Client Center Update 2.0.3.3 is published… ! (http://smsclictr.sourceforge.net/update/)

Changes:

  • Running executions will show more details (Thanks to Mark Whittle)
  • Advertisements for Task-Sequences do now have a different icon than normal advertisements.
  • Packages from within a TS will be highlighted with a different color (green) in the advertisements list. 
  • some bug fixes…

 

Version 2.0.4 (The MSI version) should be ready at MMS (without warranty).

Posted: Feb 22 2011, 09:35 PM by rzander | with no comments
Filed under: , ,
SCCM Client Center Update 2.0.3.2

The Update 2.0.3.2 for SCCM Client Center is published http://smsclictr.sourceforge.net/update/

The update contains two new features...

 

User based Advertisements (provided by Mark Whittle):

- Show and Re-Run Advertisements that are assigned to users

 

SCCM R3 Power Management (provided by Mattias Benninge)

- Show Power Configuration

- Show Daily usage (Computer, Monitor and User activity)

- Show Power Events

 

Daily Usage

 

Posted: Dec 30 2010, 09:00 AM by rzander | with no comments
Filed under: , ,
SCCM Client Center V2.0.3 released

 I'm proud to announce Version 2.0.3 of SCCM Client Center : http://sourceforge.net/projects/smsclictr/

 

Changes:

- Patch Mgmt can also show only approved updates

- Edit Hardware Inventory Classes

- Show Services without WMI

- x64 improvements and fixes

- Logging improved

- Some other minor updates :-)

 

Readme.txt contains some additional informations arround the license types of the different components...

 

And finally some project related links:

Project Page:      <http://sourceforge.net/projects/smsclictr/>
Click Once Installation:    <http://smsclictr.sourceforge.net/>
SVN Source Code Repository:    <https://smsclictr.svn.sourceforge.net/svnroot/smsclictr>
SVN Source Code Viewer:    <http://smsclictr.svn.sourceforge.net/viewvc/smsclictr/>
SMSCliCtr.Automation DLL&Help:   <http://smsclictr.sourceforge.net/smsclictr.automation/>
Minor Updates and Fixes:   <http://smsclictr.sourceforge.net/update/>
SystemCenterUpdatePublisher(SCUP) 4.5 Catalog:  <http://smsclictr.sourceforge.net/update/WinWorkers.cab>
Help Forum; Feature Requests:   <http://sourceforge.net/projects/smsclictr/support>
Wiki Page:     <http://sourceforge.net/apps/mediawiki/smsclictr/>

 

Posted: Nov 23 2010, 03:56 PM by rzander | with no comments
Filed under: , ,
SCCM Update Status is out of sync…

I’ve seen SCCM Sites where the Security Patch Status was not in sync with the information on the Clients…

To fix this behavior, you have to resend a full compliance report from every client. The following article describes how to do it:

http://msdn.microsoft.com/en-us/library/cc146437.aspx

Posted: Oct 29 2010, 03:58 PM by rzander | with no comments
Filed under:
Show User Notification from Package or Task-Sequence….

A way to show a simple user notification message from a Task-Sequence or a Software Package is to use the following command (as one line):

powershell.exe -command $a = New-Object -comobject SMSCliUI.UIEvents; $a.ShowMessage('User Notification', 'Please restart your computer...', 1)

The message will be visible even if the package runs with System privileges and the flag “Allow users to interact with this program” is not enabled.

Posted: Oct 29 2010, 02:34 PM by rzander | with no comments
Filed under: , ,
Funny German Error Message

clip_image001

More Posts Next page »