You are browsing the archive for 2010 October.

SCCM OSD issue with Win7 x64 bit deployment on HP 8740W

12:16 pm in ConfigMgr, ConfigMgr 2007, ConfigMgr 2007 R2, ConfigMgr SP2, configmgr2007, ConfigMgr2007 R3, Deployment, Drivers, Installation, Operating System Deployment, OSD, sccm, SCCM 2007, SCCM 2007 R2, SCCM 2007 R3, SCCM 2007 SP2, sccm2007, Windows 7 by Kenny Buntinx [MVP]

Hi,

I was deploying a windows 7 64 bit, at a customer on a HP 8740W , witch is a monster machine ( core I7 , Nvidia Quatro 512 mb graphics , etc ) but during the step “setup windows and Configmgr” it fails with the following error :

Windows setup failed, code 31

Failed to run the action: Setup Windows and ConfigMgr.
Unspecified error (Error: 80004005; Source: Windows)

Looking further in the SMSTS.log it looks like :

——SMSTSLog—–

Command line for extension .EXE is "%1" %*    OSDSetupWindows    4/29/2010 7:45:19 PM    1576 (0x0628)
Set command line: "\\<yourSCCMServer>\SMSPKGE$\ABC00014\SOURCES\SETUP.EXE" "/unattend:C:\_SMSTaskSequence\unattend.xml" /noreboot    OSDSetupWindows    4/29/2010 7:45:19 PM    1576 (0x0628)
Executing command line: "\\<yourSCCMServer>\SMSPKGE$\ABC00014\SOURCES\SETUP.EXE" "/unattend:C:\_SMSTaskSequence\unattend.xml" /noreboot    OSDSetupWindows    4/29/2010 7:45:19 PM    1576 (0x0628)
Process completed with exit code 31    OSDSetupWindows    4/29/2010 7:45:34 PM    1576 (0x0628)
Windows Setup completed with exit code 31    OSDSetupWindows    4/29/2010 7:45:34 PM    1576 (0x0628)
Entering ReleaseSource() for \\<yourSCCMServer>\SMSPKGE$\ABC00014\    OSDSetupWindows    4/29/2010 7:45:34 PM    1576 (0x0628)
reference count 1 for the source \\<yourSCCMServer>\SMSPKGE$\ABC00014\ before releasing    OSDSetupWindows    4/29/2010 7:45:34 PM    1576 (0x0628)
Released the resolved source \\<yourSCCMServer>\SMSPKGE$\ABC00014\    OSDSetupWindows    4/29/2010 7:45:34 PM    1576 (0x0628)
exitCode == 0, HRESULT=80004005 (e:\nts_sms_fre\sms\client\osdeployment\setupwindows\setupwindows.cpp,440)    OSDSetupWindows    4/29/2010 7:45:34 PM    1576 (0x0628)
Windows setup failed, code 31    OSDSetupWindows    4/29/2010 7:45:34 PM    1576 (0x0628)
setup.run(), HRESULT=80004005 (e:\nts_sms_fre\sms\client\osdeployment\setupwindows\setupwindows.cpp,1707)    OSDSetupWindows    4/29/2010 7:45:34 PM    1576 (0x0628)
Exiting with code 0x80004005    OSDSetupWindows    4/29/2010 7:45:34 PM    1576 (0x0628)
Process completed with exit code 2147500037    TSManager    4/29/2010 7:45:34 PM    1384 (0x0568)

——SMSTSLog—–

 

This error (error 31) could have multiple causes in my environment. I will summarize them below :

  • As I was deploying from OEM Media  kit ( Yes , I know , companies should have a volume license key ) , it could cause some issues as on the OEM Media there is no such thing as a Pid.txt where the product key is stored . OEM media uses the unique key that has been sticked under your pc/ Laptop
  • A badly written Unattend.xml , but as that xml has been used at other customers as well and posted on my blog , it seems unlikely .
  • The Product key mentioned in the Task Sequence . Checked it , no product key mentioned .This error usual happens though because you are using an MAK key when you should not be using any key during the TS — you can use the KMS client key (this is different than the KMS Server key you get from the MVLS site), but this is not required as your KMS client key is embedded in the OS source files in a file called pid.txt mentioned earlier.
  • Faulty Drivers ….

 

I eliminated very soon 2 of the 4 options and was left over with :

  • As I was deploying from OEM Media  kit ( Yes , I know , companies should have a volume license key ) , it could cause some issues as on the OEM Media there is no such thing as a Pid.txt where the product key is stored . OEM media uses the unique key that has been sticked under your pc/ Laptop
  • Faulty Drivers ….

 

Next step I have disabled the step “Auto apply drivers” and magically the setup continued …. That’s funny  , so it has to be a driver….

Now that I know my root cause , lets investigate. The fun part is that Configmgr has the possibility to disable drivers on an easy way.

After some testing it became clear that the “IDT High Definition Audio Codec” was giving me error 31 because it has been written very crappy !

Solution :

  1. Remove the driver from the database
  2. Create a software Package and launch the setup via Setup.exe in your Task Sequence .

 

It now works like a charm .

 

Hope it Helps ,

Kenny Buntinx

Softgrid 4.1 migration towards ConfigMgr with App-V 4.6 Integration : The story of automation , Part 2.

11:13 am in App-V, AppV, ConfigMgr, ConfigMgr 2007, ConfigMgr 2007 R2, ConfigMgr SP2, configmgr2007, ConfigMgr2007 R3, migration, R3, sccm, SCCM 2007, SCCM 2007 R2, SCCM 2007 R3, SCCM 2007 SP2, sccm2007, script, Softgrid, WMI by Kenny Buntinx [MVP]

Yesterday , I have started explaining my little migration project to migrate away from a standalone Softgrid 4.1 infrastrucure towards a fully integrated SCCM2007 SP R2 App-V 4.6 infrastructure . You can read my previous post right here : http://scug.be/blogs/sccm/archive/2010/10/18/softgrid-4-1-migration-towards-configmgr-with-app-v-4-6-integration-the-story-of-automation-part-1.aspx

Below I will discuss the migration scenario once more in a few bullet points to migrate away from the Softgrid 4.1 standalone environment :

  1. Deploy the new app-V 4.6 clients on all workstations and check for inconsistencies (luckily all packages where sequenced with 4.2)  DONE in Part 1
  2. Pull all existing Softgrid 4.2 sequenced packages thru the new App-V 4.6 Sequencer to avoid any complications. DONE in Part 1
  3. Import all packages into ConfigMgr 2007 SP2 R2 DONE in Part 1
  4. Create all necessary collections and create a dynamic membership query with a AD group name.
  5. Create all the necessary advertisements.
  6. Switch over from Softgrid standalone to Configmgr 2007 R2 SP2. (Think about network impact !)

 

So that will leave us to creating all the necessary collections ( remember 400 Pieces ) and their lovely 400 AD Group Memberships as this was how the Softgrid environment worked (User Group Based) before.

You could accomplish this in basically 2 ways , with a Direct or Dynamic collection membership. Both will have different pro’s  & cons and I will try to explain the difference below :

1. Creating a Dynamic collection membership based on the User Group Resource that will point to an AD Security Groups that contains users in AD for Collection Population.

Assuming there is a best case ( not best practice ! ) scenario where  it can take at least a maximum possible latency (In the case below) of = 3hrs 15 minutes

  • AD Replication to happen – 15 minutes.
  • AD Security Group Discovery – 60 minutes (this is a very short setting – default is a day). ( R3 could save you another 55 minutes here with Delta Discovery enabled )

          image

  • As this is a dynamic membership collection , it is bound to a Collection evaluation cycle – 60 minutes (this is a very short setting – default is a day).
  • Configuration Manager Client Policy Refresh – 60 minutes (Default).

2. Creating a Direct collection Membership based on the User Group Resource that will point to an AD Security Groups that contains users in AD for Collection Population.

Assuming there is a worst case scenario where  it can take at least a maximum possible latency (in the case below) of = 60 minutes

  • Configuration Manager Client Policy Refresh – 60 minutes (Default).
  • User may needs to log off and log-on again.

Option nr 1 is not an approach that I’m  in favor off  as it introduces a much higher latency then option nr 2. I can live with the fact that users may need to do a logon/Logoff to receive there applications. As we have decided to go for option nr2 , it is now time to create a script and to do the following :

  1. Create a collection based on the “Virtual app” name that is been extracted out of the manifest.xml found in the folder of the \\<Servername>\VirtualPackageSource\<Package Name> under a allready existing SUB – Collection
  2. When creating the collection , create a direct collection membership with the Application AD Security group Name . (based on the resourceID)

To accomplish step 2 , you will need as prerequisite to turn on AD Security group discovery in your site settings. When done, you could pull out of SQL a *.csv file with all your Security group names and resource id’s as shown below . Please save the file as you will need it in a later phase .

image

Figure 1: This is how SCCM stores their security group information in the SQL db ( ResourceID/SecurityGroup)

Now we start working on the script , as we need the ResourceID to make it work

Below I will post the VBS code to only create 1 collection and link 1 Security Group :


 

Now I need to figure out how to link the ResourceID’s & groups with my softgrid AppID’s & Security Groups ( as shown below )  . However this will not be an easy task as I need to convert a LDAP GUID to a readable security groupname , make the correlation between the previous exported ResourceID/Security group name  and the converted GUID SecurityGroupName/AppID .

image

Figure 2: This is how Softgrid stores their security group information in the SQL db ( AppID/SecurityGroup (GUID))

Stay tuned for Part 3 very soon ….

 

Hope it Helps ,

 

Kenny Buntinx

ConfigMgr 2007 R3 : Installing Hotfix Prerequisite KB977384 on a Site Server with ICP Pack will fail.

6:26 am in ConfigMgr, ConfigMgr SP2, ConfigMgr2007 R3, Installation, R3, SCCM 2007 R3, SCCM 2007 SP2 by Kenny Buntinx [MVP]

When you install an ICP pack on your Site Server , the Site Server version number gets incremented. When you want to install the R3 Prereq hotfix (977384), it checks to make sure it is not being installed on a ICP Site Server as there is no support yet for any other languages than English. In Europe this happens more than in other parts of the world.

Basically if you try to install this hotfix on a ConfigMgr 2007 SP2 Site Server running an ICP the installation will fail with the following message :

This hotfix is not valid for this version of Configuration Manager"

 

Their is no supported way to uninstall a ICP pack from a site server , and that leaves you only with one  or two options :

  • Wait for the hotfix KB977384 with ICP1 and/or ICP2 support to be released.
  • Install R3 on a Site Server that isn’t running an ICP.

 

Hope it Helps ,

 

Kenny Buntinx

Softgrid 4.1 migration towards ConfigMgr with App-V 4.6 Integration : The story of automation , Part 1.

8:05 pm in App-V, AppV, ConfigMgr, ConfigMgr 2007 R2, ConfigMgr SP2, configmgr2007, ConfigMgr2007 R3, Installation, migration, R3, sccm, SCCM 2007 R2, SCCM 2007 R3, SCCM 2007 SP2, sccm2007, script, SDK, Softgrid, Toolkit by Kenny Buntinx [MVP]

Today we have reached the second phase of migrating the existing Softgrid 4.1 stand-alone infrastructure towards the already upgraded and optimized System Center Configuration Manager 2007 SP2 R2 that we did in fase 1.

We all know that integrating a standalone Softgrid/App-V infrastructure towards a integrated Configmgr 2007 SP2 R2 – App-V implementation could only be done with a big bang. It is either On or Off. We also know that Softgrid sequenced app’s lower then version 4.5 can cause issues and more important , they are lacking the manifest.xml file that is necessary to create virtual packages in ConfigMgr 2007 SP2 R2.

 

image

 

Below I will discuss the migration scenario in a few bullet points to migrate away from the Softgrid 4.1 standalone environment “

  1. Deploy the new app-V 4.6 clients on all workstations and check for inconsistencies (luckily all packages where sequenced with 4.2)
  2. Pull all existing Softgrid 4.2 sequenced packages thru the new App-V 4.6 Sequencer to avoid any complications.
  3. Import all packages into ConfigMgr 2007 SP2 R2
  4. Create all necessary collections and create a dynamic membership query with a AD group name.
  5. Create all the necessary advertisements.
  6. Switch over from Softgrid standalone to Configmgr 2007 R2 SP2. (Think about network impact !)

 

Step 1 :

As the old Softgrid 4.1 stand-alone infrastructure has around 400 virtual packages , and they need to pass thru the app-V 4.6 sequencer to avoid any inconsistencies or complications , the last thing you want to do is play the monkey and open up all packages in the sequencer and save them manually … For this part I had very good teamplayers that are very skilled VBscript writers , again a big thank you to Ewald Lieuwes ( http://www.wchulseiee.net/) & Wouter Schrijvens …

Below I will post the VBS code written for :

 

  1. Going thru the list of virtual packages stored at E:\Softgrid\<Package Name>….
  2. Open them one by one in the App-V 4.6 sequencer and save then to a new location called F:\App-V\<Package Name> to have a backup!
  3. As you see in this script ,we use E:\, F:\ and U:\. The U:\ is the virtual drive partition (default this is Q:\)
  4. Make sure the virtual drive partition is big enough for all of your packages. In this case, this was limited to 2 GB ( standard as Softgrid 4.1 has this limitation of 2 GB in the size of sequenced apps ). We had to resize this to 50 GB.

 

 The code :


 

Step 2 :

As we need to import all 400 upgraded App-V 4.6 virtual packages into ConfigMgr , the last thing you want to do is play the monkey and create all packages in ConfigMgr 2007 R2 SP2 by hand … For this part I had a very good teamplayers that are very skilled VBscript writers , again a big thank you to Ewald Lieuwes ( http://www.wchulseiee.net/) & Wouter Schrijvens …

 

You could do it by using the ConfigMgr SDK , located at http://www.microsoft.com/downloads/en/details.aspx?familyid=064a995f-ef13-4200-81ad-e3af6218edcc&displaylang=en or you could use a standard base script that is located under <Drive>\<PathWhereYouInstalledSCCM>\Tools\VirtualApp\ManageVappPackage.vbs and wrap another VB script around it to build in some other checks or functionalities.

I used the default script located  under <Drive>\<PathWhereYouInstalledSCCM>\Tools\VirtualApp\ManageVappPackage.vbs and wrap another VB script around it .

Below I will post the VBS code written for :

 

  1. Going thru the list of upgraded 4.6 virtual packages stored at a DFS share \start\sccmsrc\[VIRTUALPACKAGESRC]\">\start\sccmsrc\[VIRTUALPACKAGESRC]\">\start\sccmsrc\[VIRTUALPACKAGESRC]\">\\<YourDomainName>\start\sccmsrc\[VIRTUALPACKAGESRC]\<Package Name>….
  2. Create a Source directory App-V package Folder for SCCM , In this case \\<ServerName\VIRTUALPKG$\<Package Name>… , if not exists.
  3. Import the App-V Package in ConfigMgr and add it to the distribution points , called \\CMSRV and \\CMDPMP
  4. Run this script on your SCCM box where your SCCM provider is installed !!

 

The code :


 

In Part 2 , I will continue to blog , if I technically manage to succeed in the following days to do the following :

  • Create all necessary collections and create a dynamic membership query with a AD group name on a automated fashion.
  • Create all the necessary advertisements on an automated fashion.

     

    Come back and check soon.

     

    Hope it Helps ,

     

    Kenny Buntinx

  • System Center Configuration Manager 2007 R3 has arrived

    6:11 pm in configmgr2007, ConfigMgr2007 R3, R3, SCCM 2007 R3 by Kenny Buntinx [MVP]

    Today Jeff Wettlaufer has announced at http://blogs.technet.com/b/systemcenter/archive/2010/10/14/configuration-manager-2007-r3-is-here.aspx that ConfigMgr R3 has been RTM’ed.

    You must all known as well that this is the FIRST release EVER within Microsoft been made that carries the name R3.

    Soon I will write a blog on how to install the final RTM code & if you really want to know how it really works in practice and what the caveats are , come to my session “ConfigMgr R3 , Notes from the field” at our own Belgian System Center Day at November 3thd. Register at http://systemcenterday.eventbrite.com/

    I am very excited to announce and to talk about the release of System Center Configuration Manager 2007 R3. ConfigMgr R3 drives new scenario support to existing world class capabilities.

    Below I will list a few :

    • Power Management for Green IT. When combined with competitive, environmental and regulatory pressure, it is really exciting to deliver centralized, policy based Power Management in ConfigMgr.
    • With ConfigMgr R3, 300,000 managed clients per hierarchy could be managed.
    • By tightening the key relationship to Active Directory with finer, more granular polling and delta monitoring, and marrying this with a new ability to rapidly populate those changes into collections. 
    • Some additional OSD Scenarios , such a Pre-staged Media.
    • Some always wanted ConfigMgr Administrator console extensions , such as “Add a resource to a collection” on a simplified way.

     

    See you at 3 November @ Living Tomorrow when delivering an ConfigMgr R3 session .

     

    Kenny Buntinx.

    ConfigMgr Dashboards and Software Update General Compliance Gauge

    11:25 am in AdminUi, ConfigMgr, ConfigMgr 2007, ConfigMgr 2007 R2, ConfigMgr Dashboards, ConfigMgr SP2, configmgr2007, Dashboards, Reporting, sccm, SCCM 2007, SCCM 2007 R2, SCCM 2007 R3, SCCM 2007 SP2, SCCM Dashboards, sccm2007, SQL, SQL Reporting services, SRS by Kenny Buntinx [MVP]

    Microsoft released last year the Configuration Manager 2007 dashboards.A dashboard is basically a webpage containing multiple reports with graphs. The dashboard is a WSS 3.0 / MOSS 2007 solution that tries to give an high level graphical representation of the data contained in ConfigMgr. This enables ConfigMgr administrators to have multiple information in reports on a single page or in this case to help IT managers what is happening in their environment without all the report data .

    A manager at a customer asked me if it would be possible to have a general percentage of Software Update Percent Compliance spread over all the Software deployment Management advertisements that are targeted to Pre-Production and Production.

    To accomplish this written a SQL query to to this . As I don’t take all the credit for doing this , I will refer to them during my blog post .

    I started with getting my initial report SQL code from Kent Agerlund (MVP configMgr) on http://blog.coretech.dk/confmgr07/config-mgr-inventory-and-reporting/status-report-for-software-update-deployments/

    As soon as I used this SQL Query in My SCCM Dashboards , I quickly saw that I could not use the value “% Compliance” on the Y axis in combination with my “Deployment” name. It is shown below in the picture :

     

    image

     

    As I needed to have the Percentage of my total compliance spread over my SDM Lists ,  I needed to modify the query . I want to special thank Raghu Kethineni for his help understanding this query .This is how the SQL query should look like to use the value “% Compliance” on the Y axis in combination with my “Deployment” name :

     

    Select Deploymentname, Available, Deadline,

    cast(((cast([Compliant] as float) / (ISNULL([Compliant], 0) + ISNULL([Enforcement state unknown], 0) + ISNULL([Successfully installed update(s)], 0) + ISNULL([Failed to install update(s)], 0) + ISNULL([Installing update(s)], 0) + ISNULL([Waiting for another installation to complete], 0) + ISNULL([Pending system restart], 0) + ISNULL([Downloading update(s)], 0)))*100) as Numeric(10,2)) AS ‘% Compliant’,

      [Compliant],

      [Enforcement state unknown],

      [Successfully installed update(s)],

      [Failed to install update(s)],

      [Installing update(s)],

      [Waiting for another installation to complete],

      [Pending system restart],

      [Downloading update(s)]

    From

    (select

    a.AssignmentName as DeploymentName,

    a.StartTime as Available,

    a.EnforcementDeadline as Deadline,

    sn.StateName as LastEnforcementState,

    count(*) as NumberOfComputers

    from v_CIAssignment a

    join v_AssignmentState_Combined assc

    on a.AssignmentID=assc.AssignmentID

    join v_StateNames sn

    on assc.StateType = sn.TopicType and sn.StateID=isnull(assc.StateID,0)

    group by a.AssignmentName, a.StartTime, a.EnforcementDeadline,

          sn.StateName) as PivotData

    PIVOT

    (

    SUM (NumberOfComputers)

    FOR LastEnforcementState IN

    ( [Compliant],

      [Enforcement state unknown],

      [Successfully installed update(s)],

      [Failed to install update(s)],

      [Installing update(s)],

      [Waiting for another installation to complete],

      [Pending system restart],

      [Downloading update(s)])

    ) AS pvt

    ****** SQL Query end ******

    After modifying the SQL query , the value appeared in the list as shown below in the attached picture :

    image

     

    If you need to select specific SDM advertisements , like I had to split up “Pre-Production” from “Production” , I had to modify my SQL query once again by adding a filter as show in the code below . In this case we want to only have the Production .

    ****** SQL Query ******

    Select Deploymentname, Available, Deadline,
    cast(((cast([Compliant] as float) / (ISNULL([Compliant], 0) + ISNULL([Enforcement state unknown], 0) + ISNULL([Successfully installed update(s)], 0) + ISNULL([Failed to install update(s)], 0) + ISNULL([Installing update(s)], 0) + ISNULL([Waiting for another installation to complete], 0) + ISNULL([Pending system restart], 0) + ISNULL([Downloading update(s)], 0)))*100) as Numeric(10,2)) AS ‘% Compliant’,
      [Compliant],
      [Enforcement state unknown],
      [Successfully installed update(s)],
      [Failed to install update(s)],
      [Installing update(s)],
      [Waiting for another installation to complete],
      [Pending system restart],
      [Downloading update(s)]
    From
    (select
    a.AssignmentName as DeploymentName,
    a.StartTime as Available,
    a.EnforcementDeadline as Deadline,
    sn.StateName as LastEnforcementState,
    count(*) as NumberOfComputers
    from v_CIAssignment a
    join v_AssignmentState_Combined assc
    on a.AssignmentID=assc.AssignmentID
    join v_StateNames sn
    on assc.StateType = sn.TopicType and sn.StateID=isnull(assc.StateID,0)
    where AssignmentName NOT like ‘%_PREPROD_%’
    group by a.AssignmentName, a.StartTime, a.EnforcementDeadline,
          sn.StateName) as PivotData
    PIVOT
    (
    SUM (NumberOfComputers)
    FOR LastEnforcementState IN
    ( [Compliant],
      [Enforcement state unknown],
      [Successfully installed update(s)],
      [Failed to install update(s)],
      [Installing update(s)],
      [Waiting for another installation to complete],
      [Pending system restart],
      [Downloading update(s)])
    ) AS pvt

    ****** SQL Query end ******

     

    If done and you saved your dashboard  query , It will look like this :

     

    image

     

    Hope It Helps  ,

     

    Kenny Buntinx

    Configmgr OSD Task sequence ; Success or Failure notification

    2:12 pm in ConfigMgr, ConfigMgr 2007, ConfigMgr 2007 R2, ConfigMgr SP2, configmgr2007, ConfigMgr2007 R3, Operating System Deployment, OSD, R3, sccm, SCCM 2007, SCCM 2007 R2, SCCM 2007 R3, SCCM 2007 SP2, sccm2007 by Kenny Buntinx [MVP]

    A customers demanded for local support staff to have a simple feature in ConfigMgr 2007 . This feature would be that when operating system deployment has been launched in production , the Local Support staff would receive a simple email to say that their deployment was succeeded or not without touching any ConfigMgr console. Out of the box , this was not feasible . A colleague of mine ( Merlijn  Vanwaeyenberghe)  at  that particular customer found a rather simple but effective solution .

    The steps to reproduce this solution are mentioned below :

    1. Go to the Status filer Rules  in the following section  :

    image 

    2. Create two status filter rules as shown below .

    image

    3.Configure the Status filter Rules as shown below. Create a Status Filter Rule with the following properties:

    · To notify when a specific TS has succeeded:

      • Source: ConfigMgr Client
      • Site Code: site code
      • Message ID: 11143
      • Property: Package ID
      • Property Value: Package ID for the OSD Task Sequence to be monitored

    image

    · To notify when a specific TS has failed:

      • Source: ConfigMgr Client
      • Site Code: site code
      • Component: Task Sequence Engine
      • Severity: Error
      • Property: Package ID
      • Property Value: Package ID for the OSD Task Sequence to be monitored

    image

    · Actions for both cases:

      • Create 2 Powershell scripts on your local drive. In my case D:\scripts\TSSucceeded_Email_Notification.PS1 and D:\scripts\TSFailed_Email_Notification.PS1 with the following code snippets that are listed below.

    image

    **********Code Snippet – FAILED ***********

    param([string]$strComputerName)
    $erroractionpreference = "SilentlyContinue"
    $strSMTP = "Your SMTP server "
    $strSubject = $strComputerName+": OS Deployment FAILED"
    $strBody = @"
    The OSD Task Sequence "The name of your tasksequence" has

        * FAILED *

    op $strComputerName

    http://yourSCCMServer/SMSReporting_XXX/Report.asp?ReportID=143&AdvertID=90020066&ComputerName=$strComputerName&SortRs1Col=1&SortRs1Dir=2
    "@
    $MailMessage = New-Object System.Net.Mail.MailMessage
    $SMTPClient = New-Object System.Net.Mail.smtpClient
    $SMTPClient.host = $strSMTP
    $Sender = New-Object System.Net.Mail.MailAddress("zzz@Yourcompany.zzz ", "SCCM”)
    $Recipient = New-Object System.Net.Mail.MailAddress( “zzz@Yourcompany.zzz, "ZZZ")
    $MailMessage.Sender = $Sender
    $MailMessage.From = $Sender
    $MailMessage.Subject = $strSubject
    $MailMessage.To.add($Recipient)
    $MailMessage.Body = $strBody
    $SMTPClient.Send($MailMessage)

    ***********Code Snippet – FAILED ***********

    **********Code Snippet – SUCCEEDED **************

    param([string]$strComputerName)
    $erroractionpreference = "SilentlyContinue"
    $strSMTP = "Your SMTP server "
    $strSubject = $strComputerName+": OS Deployment Succeeded"
    $strBody = @"
    The OSD Task Sequence "The name of your tasksequence"" is

        * SUCCEEDED *

    op $strComputerName
    "@
    $MailMessage = New-Object System.Net.Mail.MailMessage
    $SMTPClient = New-Object System.Net.Mail.smtpClient
    $SMTPClient.host = $strSMTP
    $Sender = New-Object System.Net.Mail.MailAddress("zzz@Yourcompany.zzz ", "SCCM")
    $Recipient = New-Object System.Net.Mail.MailAddress("zzz@Yourcompany.zzz ", "ZZZ")
    $MailMessage.Sender = $Sender
    $MailMessage.From = $Sender
    $MailMessage.Subject = $strSubject
    $MailMessage.To.add($Recipient)
    $MailMessage.Body = $strBody
    $SMTPClient.Send($MailMessage)

    **********Code Snippet – SUCCEEDED ***********

     

      • Run a program: path to program with optional parameters !! DO NOT USE "QUOTES" !!

             image

             In this Case : c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -file D:\scripts\TSSucceeded_Email_Notification.PS1 %msgsys

     

    Status filter rules can be used to perform an action when an event has occurred, for instance when an OSD Task Sequence has completed successfully or has failed, an email can be sent out to the OS staging team to inform them as shown above . Don’t let it stop you doing it for other tasks as well . Special thanks to my colleague Merlijn Vanwaeyenberghe for sharing this with us .

     

    Hope it Helps ,

     

    Kenny Buntinx