Sample Custom Task Sequence Step

Rating: No reviews yet
Downloads: 150
Released: Apr 30, 2009
Updated: Apr 30, 2009 by rhearn
Dev status: Beta Help Icon

Recommended Download

Example TaskSequenceActionForm
example, 74K, uploaded Apr 30, 2009 - 150 downloads

Release Notes

This is a complete Visual Studio project template that can be used with the SCIF source code to quickly create a custom task sequence step within ConfigManager.

How to use this template

The following is a step by step process for using this template to create a task step that runs a VBScript on a client.
  • Set up Integration Kit
    1. Download the source code of the SCIF and Unzip the SCIF source code file into a directory
    2. Launch the project:
      1. Go to \IntegrationKit directory
      2. Double-click IntegrationKit.csproj (VS starts)
    3. Redo the signing (SNK) file
      1. Right-click the project and select Properties -> Signing
    4. Fix the assembly references
      1. Open references and reset reference assemblies (point to SCCM directory where DLLs are)
    5. Build the IntegrationKit

You now have assemblies you can use in references for the new task sequence form project
  • Set up new TS action project
    1. Copy the template into VS
      1. Make a SCIF directory under \Visual Studio 2008\Templates\Project Templates
      2. Copy the ZIP file into this directory
    2. Create new project from template
      1. In VS, select File > New > Project
      2. Select SCIF > TaskSequenceActionForm
    3. Open references and reset reference assemblies (point to DLLs in the integration kit)
    4. Make sure the project will build like this
    5. Press F6 to Build
    6. Setup post-build command line to help for debugging:
      1. COPY "$(TargetDir)Task." "C:\Program Files\Microsoft Configuration Manager\AdminUI\XmlStorage\Extensions\bin\SCIF"
    7. Setup debug execution parameters
      1. Command Line: C:\Windows\System32\mmc.exe
      2. Parameters: "C:\Program Files\Microsoft Configuration Manager\AdminUI\adminconsole.msc"
  • Customize the form
    1. Load dialog editor for the form
    2. Add a text box to hold the script text
      1. Add a text box
      2. Make it multi-line with scroll bars
    3. Add a button to allow the user to import a file
      1. Add a button
      2. Make the label “Import”
    4. Add code to enable the “Apply” button when text changes on the form
      1. Add an event for TextChanged on the textbox: { this.SetMyDirtyFlag(true); }
    5. Add the code to import a script when the user clicks the button
      1. Add an event for Click on the button
textBox1.Text = IntegrationKitUtilities.ImportTextFile();
if string.IsNullOrEmpty(content == false)
{
	textBox1.Text = Content
}

  1. Add the code to save our custom properties for the form
    1. Add the following to SetProperties():
    2. SavePropertyInXml("EmbeddedFile", textBox1.Text);
  2. Add the code to get our custom properties from PropertyManager
    1. Add the following to SetupForm(): textBox1.Text = GetPropertyFromXml("EmbeddedFile");

  1. Modify the ClientActions property with the following:
clientActions = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + 
"<ClientTaskFile SchemaVersion=\"1.0\" Created=\"2007-10-23T12:00:00.000Z\">" + 
"<ConfigurationTask>"+
"<Task Order =\"0\" CommandType=\"VBScript\"  Executable=\"myscript.vbs\" RunWindow =\"Normal\">"+
"<Parameter Order=\"0\" ParamSwitch=\" \" ParamValue=\"myscript.vbs\" ParamType=\"EmbeddedFile\"/>"+
"<ResultCodes>"+
"<ResultCode Code=\"0\" ResultType =\"Success\" Description=\"Success\"/>"+
"<ResultCode Code=\"1\" ResultType=\"Failure\" Description=\"Failed!\"/>"+
"</ResultCodes>"+
"</Task>"+
"</ConfigurationTask>"+
" </ClientTaskFile>";

  1. Press F6 to Build to project
  • Install the new components
    1. Copy SCIF_Utils.wsf to OSD\Lib\Packages\SCIF
    2. Copy all the files in bin\debug and put them in XmlStorage\Extensions\bin\SCIF
    3. Copy the SCCMIdkInstaller.exe file from \IntegrationKit\InstallerCLI\bin\debug and put it in XmlStorage\Extensions\bin\SCIF
    4. Install the task sequence step and create the client script package
      1. Run “SCCMSdkInstaller.exe Installer.xml” from the SCIF dir

Reviews for this release

No reviews yet for this release.