Adding Multiple Task Sequence Variables to Devices using C#

Hello,
I am hoping someone can help me with a small program I am writing for our company.  We are writing a small program in C# to import computers to a particular imaging collection and we need 2 variables set.  We have been able to create a single variable
using this guide: http://msdn.microsoft.com/en-us/library/jj218235.aspx
The problem is that when we write the 2nd variable, the first one is overwritten.  It looks like that property is an array.  I've been trying to find a way, either using the SCCM 2012 R2 SDK or just adding it via the standard System.Management
functionality.
I'm sure there is a way to do it, the Powershell CMDLets will add variables rather than overwrite.  We are trying to avoid that due to some PowerShell restrictions.
Any help would be much appreciate, I'm sure the answer is not as difficult as I'm making it but I'm stuck as I am not really a programmer, but, like many of us, have to function as one at times.
Thanks!

Certainly, here you are (I've removed some company-specific info and replaced it with generic info). I'll note - this code does work to add a variable to a device in SCCM. When adding multiple variables though, the first one is replaced. This code only seems
to work for adding 1 variable which is what is causing me the headache.
privatevoidAddVariable()
SmsNamedValuesDictionarynamedValues
=newSmsNamedValuesDictionary();
WqlConnectionManagerconnection
=newWqlConnectionManager(namedValues);
connection.Connect("SCCMSITESERVER");
try
// Get the computer settings.
// strResourceID is obtained via separate method “GETRESOURCEID()”
IResultObjectcomputerSettings
=null;
IResultObjectcomputerSettingsQuery
= connection.QueryProcessor.ExecuteQuery(
"Select * from SMS_MachineSettings where ResourceId = '"+strResourceID
+"'");
foreach(IResultObjectsettings
incomputerSettingsQuery)
computerSettings = settings;
if(computerSettings
== null) // It doesn't exist, so create it.
computerSettings = connection.CreateInstance(@"SMS_MachineSettings");
computerSettings["ResourceID"].StringValue
= strResourceID;
computerSettings["SourceSite"].StringValue
= "SITECODE";
      computerSettings["LocaleID"].IntegerValue
= 1033;
computerSettings.Put();
computerSettings.Get();
// Create the computer variable.
List<IResultObject>computerVariables
= computerSettings.GetArrayItems("MachineVariables");
IResultObjectcomputerVariable
=  connection.CreateEmbeddedObjectInstance("SMS_MachineVariable");
computerVariable["Name"].StringValue
= strVariableName;
computerVariable["Value"].StringValue
= strVariableValue;
computerVariable["IsMasked"].BooleanValue
= false;
// Add the computer variable to the computer settings.
        computerVariables.Add(computerVariable);
computerSettings.SetArrayItems("MachineVariables",
computerVariables);
computerSettings.Put();
catch(SmsExceptione)
MessageBox.Show("Failed
to create computer variable: "+ e.Message);
connection.Close();
Thank you for your help

Similar Messages

  • Reset Task Sequence Variables cached in WinPE - Possible ?

    Hi All,
    We are currently receiving prestaged computers from vendor, the image on the disk is out of date. I have added logic to detect old prestaged images, upon detection it will download latest wim from DP and deploy. This automatically wipes the disk before applying
    the wim. 
    During the os build an error occurs when installing the sccm client, this is because in the prestaged build i specified that the SCCM Client should be cached onto the disk. Because the contents of the disk is wiped due to the latest wim being downloaded
    and applied the task sequence still looks for the cached package which has been deleted... i imagine this is due to the information being cached in a TS Variable...
    Is there any way i can remove this variable, or perhaps all variables relating to the prestaged build if an old prestaged image is detected...?
    "note: going forward i will not be caching any packages into a prestaged build"
    Many thanks.. 

    I don't work with pre-staged media much so don't know if what you want is actually stored in a variable that can be overwritten or not; however, you can overwrite the value of any (non-read only) variable at run-time by using the standard methods
    including the set task sequence variable task or a script that uses the Microsoft.sms.ysenvironment com object.
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • OSD HTA and Task Sequence Variable

    Have a unusual issue that I cannot seem to find a answer anywhere or if it's even possible. I'm am very aware on how to setup a HTA to pass variables to the Task Sequence but there is a point where I want the HTA to display the current value of a TS Variable(s).
    It's a custom variable that is set on a prior step via a VB script. Anyone know of a simple way to call and display the value in HTML/HTA.

    The variables are available using the same COM Object that you use to set them: Microsoft.SMS.TSEnvironment. The below VBScript will dump every variable to the screen. You can take this and just add it something you've displayed in your HTA like a static
    control or text box.
    Set env = CreateObject("Microsoft.SMS.TSEnvironment")
    Wscript.echo "Dump of All Task Sequence Variables"
    For Each TSvar In env.GetVariables
    Wscript.echo "Variable " & TSvar & " = " & env(TSvar)
    Next
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • UDI Wizard - Task Sequence Variables.

    Quick question :-)
    How are the variables defined in UDI applied during an OS installation ?
    And does it take precedence over Collection variables ?
    Thx
    Rgds

    Not sure what you about "how they are applied"? Variables, aren't "applied", they are set. Variables simply contain a value and typically "something" uses the value of the variable. Now, what that "something" is depends
    upon the variable itself (if anything -- just because a variable has a value doesn't mean anything actually uses that value). And what that "something" does with the value is up to that "something".
    Many -- not all task sequence variables -- are used by the various processes/exes that correspond to the various steps in the task sequence. In fact, all the task sequence editor does is set a bunch of variables that are in turn used by the steps in your
    task sequence (the task itself is represented by a variable).
    Thus, any values you set in the TS editor are set at "design" time and passed to the TS engine when it starts on a target client. Any values set during the execution of the TS are "run" time variables and will over write the value of
    any like named variables created before they are set including design time variables since they were set at the beginning of the TS.
    Collection variables, like design time variables, are set at the start of the TS execution and thus are over-written by any subsequent setting of the same variable within the execution of the TS.
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • AD Search plus access to task sequence variables via powershell.

    Hi,
    I would like to an Active Directory search in a SCCM task sequence.
    Now there are two ways I can do this run the powershell script
    as a domain user - in the task sequence step.
    Or do something fancy in the script itself so the task sequence step
    runs as system then does a kind of connect as to do the AD search.
    The reason I am asking this is I want to know if the task sequence
    variables are available of I run the powershell script as user
    account from the task sequence UI.
    Or can I only get at them if I am running them as the system context.
    Thanks,
    Ward

    First, answer to your question: if you run an action as a different user in a task sequence (which can only be done after you leave WinPE), you lose the ability to read the task sequence variables. You'll get empty strings for every variable you query.
    Now there are several ways of getting this accomplished and it all depends on what stage of the task sequence you want to invoke something like this/what you want to do in AD.
    If just want to query AD then, by default, you don't need any special rights as any domain user can do it.
    If you want to modify something in AD then you need to be a bit more creative.
      1. If you want to run this script after the computer has joined the domain, you don't need to mess around with permissions, as any network actions will be run using the computer object on the network. As far as AD is concerned it will use ComputerName$
    account. Though obviously you'll only have read rights.
      2. Use the network access account credentials, the username/password for the account are saved onto task sequence variables so you can easily read it. The script itself would still run under the system context, but when you establish a connection
    to AD you pass the username/password of the user to connect as. Again, you'd only have read rights.
      3. If you want to modify something in AD and the task sequence has already left WinPE, then you can use the 'run as a different user' option in the 'run command' action in the SCCM task sequence. This will force the whole script to run under the context
    of the user you specified, which obviously gives you whatever rights you want, including ability to modify something in AD, but you completely lose access to task sequence variables. If you try to query any of them you just get an empty string. A way around
    this is to make the variables you know you will need as part of your script in parameters. So for example you call your script as: MyScript.ps1 -MP %_SMSTSMP% to pass the variable _SMSTSMP to your script as a parameter. You can only specify 'run as a different
    user' if the task sequence is not in WinPE though.
      4. You could use a slight variation of option 2 if you need to modify AD. Instead of using the NAA account use the username/password of an account you specify. The action still runs under system context, but the connection to AD runs with the account
    you specify. As a result, this also works in WinPE, and you have no problems accessing task sequence variables. The only problem with this one though... is how to safely pass the credentials over, and that's a big tricky problem.
    As you can see, there's several ways of getting things done, but they all have caveats :)
    Hope this helps.

  • SCCM OSD Task sequence variables via Powershell.

    Hi,
    I am trying to come up with a genernic function to read
    SCCM 2012 OSD task sequence variables where
    I can pass a varibale name:
    Is this the correct way of doing it below?
    Thanks,
    Ward
    # fnRead_SCCM_Variable
    function fnRead_SCCM_Variable($sccm_variable)
                $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
                $data =  $tsenv.Value($sccm_variable)
                return $data
    $log_path = fnRead_SCCM_Variable "_SMSTSLogPath"

    That should do the trick. For a nice blog post about the usage of task sequence variables in PowerShell, see:
    http://blogs.technet.com/b/mniehaus/archive/2009/09/22/running-powershell-scripts-as-part-of-a-task-sequence.aspx
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • SCCM 2012 SP1 - Task Sequence Variables

    Hi All,
    I have edited the task sequence with variables (OSDComputerName) which has popped fine when I do PXE boot.
    But when I do standalone media image, it doesn't ask for computer name during task sequence process. Can I make it work standalone image also? please help
    Regards, Pratap

    Let us know the result. :)
    Juke Chou
    TechNet Community Support

  • Prompt for location - Task Sequence Variable

    I am wondering if it is possible to have a task sequence pop up asking for user input on their current location.
    I am trying to create a task sequence that will prompt the user where the computer is going to be deployed to, so it will put the computer in the correct OU and such by using seperate Network Settings based on the users input. I would like it to have a list
    of options the user can choose from.
    I am not running MDT.

    I've not used UDI that much myself, but why not take a look at it. It's really worth while to start learning MDT, it will only benefit you in the long run, trust me!
    But creating your own PowerShell front end isn't really that hard (assuming you've worked a little bit with PowerShell before).
    Here's a great guide on UDI:
    http://osdblog.com/2014/01/23/integrate-udi-with-your-sccm-task-sequence-for-optional-software-deployment-and-other-features/
    Regards,
    Nickolaj Andersen | www.scconfigmgr.com | @Nickolaja

  • Using partition variable in task sequence

    I need to configure a piece of software as part of a task sequence to direct some of its files to a specific partition.  I have the ts creating 3 partitions and I'm specifying variables for each: DataDisk = 10GB, UsersDisk = 100GB, OSDisk = 100% remaining
    free space.
    The 100GB partition is the one I need the software to use. In the "Custom Tasks" section of the ts "Dump MDT Variables" step dumps all MDT variables to a text file on the local machine so I can see at that time UsersDisk = D:\, DataDisk
    = C:\ and OSDisk = V:\, but after the deployment finishes UsersDisk = E:\.  Also in the "Custom Tasks" section I'm running the "Configure Data Igloo" to configure the program.  Is there a way to set UsersDisk = E:\ before I run
    the "Configure Data Igloo" step when there's also an internal DVD drive likely using E:\?
    Edit: I should add that it's all working properly at the moment but the "Configure Data Igloo" step is referencing E:\, not %UsersDisk% and I see this causing problems latter.  Does anyone know how the drive letters are assigned?  That is,
    why does %DataDisk% = D:\ and %UsersDisk%= E:\ after deployment, why not the reverse?

    Thanks for the reply Keith.  I'm not thrilled about having to customize the partition structure either but because we use Deep Freeze we need use Data Igloo to cache user profiles on a partition other than C:\.
    What I've ended up doing is using the 'Set Task Sequence Variable' tasks to set DataDisk = D:\ and UsersDisk = E:\ and then I can reference these variables for the task that configures Data Igloo.  To be clear for anyone trying to follow this, I'm not
    actually changing the letter assigned to the partitions, I'm just assigning a value to a variable which is then referenced in later task sequence steps.
    The thing that I'm not sure about is how the partition letters are assigned.  In my case the DataDisk partition is always assigned D:\ and UsersDisk is always assigned E:\.  I thought it might be alphabetical but I changed the 'Format and Partition
    Disk' step to rename UsersDisk to ADisk and it still gets letter E:\. 
    This isn't a big deal but if anyone knows how the letters are assigned please let me know.

  • Using a environment variable that was created during the Task Sequence process - SCCM 2012 R2

    Hi,
    I'm triyng to use a environment variable that is create in the beginning of the Task Sequence.
    1. I'm using a VBScript that get the Exit Code of an application, and create the environment variable "iReturn" with the value of the exit code. (This is working)
    2. I add this variable in the CustomSettings.ini, like this "iReturn=%iReturn%
    3. After the step that I run the VBScript I put the "Gather" step to get the variables, but looking in the BDD.log the iReturn variable appears the same as the CustomSettings.ini configuration "iReturn=%iReturn%". (But, if I put a "Restart
    Computer" step after the VBScript, the BDD.log shows the iReturn variable with the right code.)
    Question: How can I update the environment variable of Windonws XP to use in the Task Sequence without restart.
    OR
    How can I configure autologon in SCCM 2012 (if have no way to update withou restart computer).
    I already tried the autologon with registry settings and a specific user, If I starts the process with this user works, but If I starts the process with other user, after the autologon the process doesnt continue, I have to do logoff and login with the user
    that I started the process.
    PS: All this steps have to be executed before the WinPE phase. 

    Environment variables must be explicitly set every time a system boots so unless you have a process to repopulate it after the reboot, it won't persist automatically.
    Why not store the value in a task sequence variable so that it persists after a reboot?
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • Format and Partition Task Sequence Not Working As Exprected When Using USB Media

    Task looks like this. 
    Had been working on PXE based task sequence, but when I use USB media, it only makes a single partition that is around the size of the USB thumb drive.
    How does this need to be changed so that it makes a C drive partition that is 80% of the total local disk space and a D drive that uses the remaining disk space when using USB boot media?

    If you choose to create a "custom" partition configuration like the one above, then you are responsible for creating any extra required partitions like a BitLocker boot partition.
    Additionally, if you are deploying on a uEFI machine, then you will also need to create the correct uEFI partitions.
    Generally I discourage creating extra partitions.
    Keith Garner - Principal Consultant [owner] -
    http://DeploymentLive.com

  • Running a Task Sequence within a Task Sequence

    We are running an SCCM 2012 R2 setup for OSD, WSUS, App Deployment and Endpoint Protection.
    To simplify the management of drivers across several OSD task sequences, I'd like to have one "master" task sequence containing only Apply Device Drivers with model specific targeting that is referenced from the OSD task sequences.
    Why would I want this? With every new computer model that is being added to the environment (We are currently supporting 20 different computer models, and the list keeps growing), I have to update one task sequence with model specific targeting for a driver
    package, then copy all the changes to several other task sequences. To try to simplify the administration and reduce the chance of human error and ensure consistency across the board, this would probably be the best way to ensure this.

    Out-of-the-box you can't start one task sequence within another task sequence. A few workarounds:
    You can make your task sequence put your computer object in a new collection which has a new task sequence targeted, but that probably won't perform that well;
    You can target multiple task sequences to the same collection and try to use PowerShell to trigger a new task sequence. For example something like this (I have never tried to use this from a task sequence):
    http://powersheller.wordpress.com/2012/05/24/sccm-2012-execute-task-sequence-with-powershell/
    You can try to merge your current task sequences.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude
    Since what I'd like to do is to "pause" the current task sequence until the second task sequence has run and then resume the current task sequence (Just the apply drivers step) I don't think either would be great options. I guess the copy paste
    option is what is left for me.
    Thanks for replying and your suggestions

  • SCCM's OSD (not MDT): Task sequence can be tweaked into imaging Windows+VHD Native Boot, but can it go all the way and deploy?

    Hello All,
    What I am trying to do is use SCCM's own OSD Task Sequence / Windows PE to deploy an operating system that boots using VHD Native Boot. (C:\ = VHD File  with Windows, D:\ Data drive with BCDBoot).
    MDT 2013 Can do it I've been told, but I am putting off MDT until Windows 10 if I can get away with it.
    TechNet VHD Native Boot on Windows 8.1:
    http://technet.microsoft.com/en-us/library/hh825689.aspx
    http://technet.microsoft.com/en-us/library/hh825691.aspx
    The good news is it is working up to the "Apply Operating System" phase, but that apply operating system phase is reported as an error even though it completes successfully. It can't clean up the SMSTS folder it's looking for on the C:\ because
    it's been moved over to the D:\ by a diskpart script. We are left with the deployment working but requiring IT staff to deal with the OOBE Personalization wizard and adding each PC to the domain manually. From that point on the SCCM client can do the rest,
    which works for US before we upgrade to Windows 10 with utilizing MDT.
    I am not talking about deploying an OS to a VHD file and putting that file on a network share i.e.
    http://blogs.technet.com/b/configurationmgr/archive/2013/10/31/new-in-system-center-2012-r2-configuration-manager-deploying-an-operating-system-to-a-virtual-hard-drive-vhd.aspx
    I reported getting the diskpart script working first here:
    https://social.technet.microsoft.com/Forums/en-US/ff124f09-1d2e-4fc4-a5b6-63b683f3d208/native-vhd-boot-deployments-from-sccm-2012-r2?forum=configmanagerosd
    Here it is:
    rem work around any USB disk left in or any CDROM detected by PE as drive D
    select volume D
    assign letter=F noerr
    rem select the formatted volume and reassign it's drive letter
    select volume C
    assign letter=D
    rem create and setup VHD file
    create vdisk file=D:\DEV_WIN81.VHD maximum=250000 type=expandable
    select vdisk file=D:\DEV_WIN81.VHD
    attach vdisk
    create partition primary
    active
    format FS=NTFS quick label="Developer Win81 VHD"
    assign letter=C
    rescan
    exit
    (type=fixed is better for performance - we'll surely activate when we have dual boot 8.1 / Windows 10 later for the Win10 VHD's)
    The Task Sequence looks like this:
    I'd like to add a few more steps after apply operating system if I can, but I have to resolve this error with "Apply Operating system before I can go further."
    Question:
    Can an OSD guru tell me if there are any Task Sequence Variables we could throw at this to make the Apply Operating System sequence complete without error so we can do all SCCM OSD Deployment steps?
    If we can, then someone (not me) gets to add a new TechNet blog post about this being possible. It's my understanding presently that only MDT can support deploying WIM files into VHDs on Workstations, that boot them.
    The install image was created using dism to convert a VHD from a Hyper-V host into a wim. I know I'm meant to use SCCM to capture it, but I don't think that's causing this problem because when we are deploying from that image to a HDD without VHD we don't
    get any issues.
    I'm only allowed enough characters to paste the tail end of the apply operating system phase only:
    <![LOG[Execution engine result code: Success (0)]LOG]!><time="18:29:37.691-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="tsmanager.cpp:929">
    <![LOG[Cleaning Up.]LOG]!><time="18:29:37.691-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="tsmanager.cpp:675">
    <![LOG[Removing Authenticator]LOG]!><time="18:29:37.691-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="tsmanager.cpp:686">
    <![LOG[shKey.DeleteValue( c_szRegValue_SecurityToken ), HRESULT=80070002 (e:\nts_sccm_release\sms\framework\ccmutillib\ccmutillib.cpp,1660)]LOG]!><time="18:29:37.691-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="ccmutillib.cpp:1660">
    <![LOG[Cleaning up task sequence folder]LOG]!><time="18:29:37.691-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="utils.cpp:2329">
    <![LOG[Unable to delete file C:\_SMSTaskSequence\TSEnv.dat (0x80070005). Continuing.]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="ccmfile.cpp:1056">
    <![LOG[hr, HRESULT=80070091 (e:\nts_sccm_release\sms\framework\core\ccmcore\ccmfile.cpp,1218)]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="ccmfile.cpp:1218">
    <![LOG[Failed to delete directory 'C:\_SMSTaskSequence']LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="2" thread="960" file="ccmfile.cpp:1218">
    <![LOG[(dwRet = ::SetNamedSecurityInfoW ((WCHAR*) pszObjectName, objectType, OWNER_SECURITY_INFORMATION, pOwnerSID, NULL, NULL, NULL)) == ERROR_SUCCESS, HRESULT=80070005 (e:\qfe\nts\sms\framework\tscore\utils.cpp,6675)]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="utils.cpp:6675">
    <![LOG[SetNamedSecurityInfo() failed.]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="3" thread="960" file="utils.cpp:6675">
    <![LOG[SetObjectOwner() failed. 0x80070005.]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="3" thread="960" file="utils.cpp:6687">
    <![LOG[SetObjectOwner (szFName, SE_FILE_OBJECT, c_szAdministrators), HRESULT=80070005 (e:\qfe\nts\sms\framework\tscore\utils.cpp,6772)]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="utils.cpp:6772">
    <![LOG[RemoveFile() failed for C:\_SMSTaskSequence\TSEnv.dat. 0x80070005.]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="3" thread="960" file="utils.cpp:6816">
    <![LOG[RemoveDirectoryW failed (0x80070091) for C:\_SMSTaskSequence]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="2" thread="960" file="utils.cpp:6900">
    <![LOG[Deleting volume ID file C:\_SMSTSVolumeID.7159644d-f741-45d5-ab29-0ad8aa4771ca ...]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="resolvesource.cpp:506">
    <![LOG[DeleteFileW(sVolumeIDFile.c_str()), HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\resolvesource.cpp,508)]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="resolvesource.cpp:508">
    <![LOG[Deleting volume ID file D:\_SMSTSVolumeID.7159644d-f741-45d5-ab29-0ad8aa4771ca ...]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="resolvesource.cpp:506">
    <![LOG[DeleteFileW(sVolumeIDFile.c_str()), HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\resolvesource.cpp,508)]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="resolvesource.cpp:508">
    <![LOG[Successfully unregistered Task Sequencing Environment COM Interface.]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="environmentlib.cpp:910">
    <![LOG[Command line for extension .exe is "%1" %*]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="commandline.cpp:228">
    <![LOG[Set command line: "X:\sms\bin\x64\TsProgressUI.exe" /Unregister]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="commandline.cpp:731">
    <![LOG[Executing command line: "X:\sms\bin\x64\TsProgressUI.exe" /Unregister]LOG]!><time="18:29:37.738-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="commandline.cpp:827">
    <![LOG[==========[ TsProgressUI started in process 8012 ]==========]LOG]!><time="18:29:37.754-420" date="12-26-2014" component="TsProgressUI" context="" type="1" thread="8040" file="winmain.cpp:330">
    <![LOG[Command line: "X:\sms\bin\x64\TsProgressUI.exe" /Unregister]LOG]!><time="18:29:37.754-420" date="12-26-2014" component="TsProgressUI" context="" type="0" thread="8040" file="winmain.cpp:332">
    <![LOG[Unregistering COM classes]LOG]!><time="18:29:37.754-420" date="12-26-2014" component="TsProgressUI" context="" type="1" thread="8040" file="winmain.cpp:204">
    <![LOG[Unregistering class objects]LOG]!><time="18:29:37.754-420" date="12-26-2014" component="TsProgressUI" context="" type="1" thread="8040" file="winmain.cpp:495">
    <![LOG[Shutdown complete.]LOG]!><time="18:29:37.754-420" date="12-26-2014" component="TsProgressUI" context="" type="1" thread="8040" file="winmain.cpp:512">
    <![LOG[Process completed with exit code 0]LOG]!><time="18:29:37.754-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="commandline.cpp:1123">
    <![LOG[Successfully unregistered TS Progress UI.]LOG]!><time="18:29:37.754-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="utils.cpp:2903">
    <![LOG[Sending success status message]LOG]!><time="18:29:37.754-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="tsmanager.cpp:784">
    <![LOG[MP server http://OUR-SCCM.ourcompany.com. Ports 80,443. CRL=false.]LOG]!><time="18:29:37.754-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="utils.cpp:5881">
    <![LOG[Setting authenticator]LOG]!><time="18:29:37.785-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="utils.cpp:5903">
    <![LOG[Set authenticator in transport]LOG]!><time="18:29:37.785-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="libsmsmessaging.cpp:7734">
    <![LOG[Sending StatusMessage]LOG]!><time="18:29:37.785-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="libsmsmessaging.cpp:4023">
    <![LOG[Setting message signatures.]LOG]!><time="18:29:37.801-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="libsmsmessaging.cpp:1295">
    <![LOG[Setting the authenticator.]LOG]!><time="18:29:37.801-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="libsmsmessaging.cpp:1325">
    <![LOG[CLibSMSMessageWinHttpTransport::Send: URL: OUR-SCCM.ourcompany.com:80 CCM_POST /ccm_system/request]LOG]!><time="18:29:37.801-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="libsmsmessaging.cpp:8604">
    <![LOG[Request was successful.]LOG]!><time="18:29:37.832-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="libsmsmessaging.cpp:8939">
    <![LOG[::RegQueryValueExW(hSubKey, szReg, NULL, NULL, NULL, &dwSize), HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\utils.cpp,811)]LOG]!><time="18:29:37.832-420" date="12-26-2014" component="TSManager" context="" type="0" thread="960" file="utils.cpp:811">
    <![LOG[RegQueryValueExW is unsuccessful for Software\Microsoft\SMS\Task Sequence, SMSTSEndProgram]LOG]!><time="18:29:37.832-420" date="12-26-2014" component="TSManager" context="" type="2" thread="960" file="utils.cpp:811">
    <![LOG[GetTsRegValue() is unsuccessful. 0x80070002.]LOG]!><time="18:29:37.832-420" date="12-26-2014" component="TSManager" context="" type="2" thread="960" file="utils.cpp:842">
    <![LOG[End program: ]LOG]!><time="18:29:37.832-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="tsmanager.cpp:805">
    <![LOG[Finalize logging request ignored from process 856]LOG]!><time="18:29:37.832-420" date="12-26-2014" component="TSManager" context="" type="1" thread="960" file="tslogging.cpp:1737">
    <![LOG[Process completed with exit code 0]LOG]!><time="18:29:37.863-420" date="12-26-2014" component="TSPxe" context="" type="1" thread="592" file="commandline.cpp:1123">
    <![LOG[Task Sequence Manager returned code 0x00000000]LOG]!><time="18:29:37.863-420" date="12-26-2014" component="TSPxe" context="" type="1" thread="592" file="tsmediawizardcontrol.cpp:2180">
    <![LOG[Exiting with return code 0x00000000]LOG]!><time="18:29:37.863-420" date="12-26-2014" component="TSPxe" context="" type="1" thread="592" file="tsmbootstrap.cpp:1238">
    <![LOG[Execution complete.]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="1" thread="760" file="bootshell.cpp:693">
    <![LOG[hMap != 0, HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\environmentscope.cpp,493)]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="0" thread="760" file="environmentscope.cpp:493">
    <![LOG[m_pGlobalScope->open(), HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\environmentlib.cpp,335)]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="0" thread="760" file="environmentlib.cpp:335">
    <![LOG[this->open(), HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\environmentlib.cpp,553)]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="0" thread="760" file="environmentlib.cpp:553">
    <![LOG[::RegQueryValueExW(hSubKey, szReg, NULL, NULL, NULL, &dwSize), HRESULT=80070002 (e:\qfe\nts\sms\framework\tscore\utils.cpp,811)]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="0" thread="760" file="utils.cpp:811">
    <![LOG[RegQueryValueExW is unsuccessful for Software\Microsoft\SMS\Task Sequence, SMSTSEndProgram]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="2" thread="760" file="utils.cpp:811">
    <![LOG[GetTsRegValue() is unsuccessful. 0x80070002.]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="2" thread="760" file="utils.cpp:842">
    <![LOG[End program: ]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="1" thread="760" file="bootshell.cpp:725">
    <![LOG[Finalizing logging from process 752]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="1" thread="760" file="tslogging.cpp:1741">
    <![LOG[Finalizing logs to root of first available drive]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="1" thread="760" file="tslogging.cpp:1583">
    <![LOG[Successfully finalized logs to D:\SMSTSLog]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="1" thread="760" file="tslogging.cpp:1640">
    <![LOG[Cleaning up task sequencing logging configuration.]LOG]!><time="18:29:37.879-420" date="12-26-2014" component="TSBootShell" context="" type="0" thread="760" file="tslogging.cpp:584">
    MCSE,MCNE,SCO,Sair Linux/GNU, Open source-enthusiast.

    I have already set it to FALSE. The solution to this will be some different OSD Task Sequence variables or a statement that it can't be made to work.
    I believe that setting defines what volume will be the BOOT / OS Drive Letter. Some people were getting D:\WINDOWS as their boot volume drive letter. Setting to true means whatever was the System Drive letter (usually C) in the image will remain as such
    after it was was applied, setting it to false will make the system have the same drive letter arrangement as what Windows PE detects. In my case I set it to false so that no matter what the new VHD file setup as drive C will be the system drive. I'll set it
    to true on the next deployment but I expect there to be no difference, because in both PE and the WIM the installation volume is the C:.
    We are talking about the DRIVE LETTERS Windows PE SCCM OSD is using for it's temporary files - and how we can manipulate these locations using OSD Task Sequence Variables, so the Apply OS doesn't try and clean up files that are not there
    - and fail with an error if you have added a VHD Native Boot volume.
    This OSDPreserveDriveLetter setting isn't having any effect on the problem here.
    I believe that Format step is setting some task variables used by the OSD Deployment process - telling it where to store it's temporary files. However between the Format Disks and Apply operating system steps the OSD Task Sequence isn't picking up on the
    fact what was the C:\ after Format HDD step is now the D:\ .
    A developer who has an understanding of how the OSD boot process executes in order would be able to see what's going on here.
    MCSE,MCNE,SCO,Sair Linux/GNU, Open source-enthusiast.

  • Can I set a priority in SCCM 2012 for advertisements or any other ideas to fix my Task sequences?

    I have several task sequences that I deploy to lab computers that we re-image 1 or 2 times a year.  The task sequences run and install specific software
    for that lab after the base image deploys.
    The base image is deployed using WDS without SCCM in the mix.  It is a setup they we are using because of legacy business processes that just make this easier.
     Then after the machine boots up and gets its SCCM policies the task sequences start running to deploy the software.
    The issue I am noticing is that I have no control over what runs first and sometimes Windows Updates that are deployed via SCCM run before or in between the task
    sequences that I have running.  Some installs fail because of the pending Windows Update reboot, which I believe I have gotten around just by checking for it and rebooting before it installs the software.  The issue is that the Windows update could
    and usually is one of those lovely updates that requires multiple reboots.  The second reboot is killing my task sequence.
    The issue is I need to somehow force this updates to run after my task sequences or make sure they run first.  The only way I can think of this is by having
    priorities for the task sequences.  I can't just add installing the updates to the task sequence, because the second reboot will kill my whole task sequence there too.
    Anyone have any ideas on how to get around this issue?  I want the machines to install the Windows updates so I can't just remove them from the collection.

    That's definitely the best option to do everything via the task sequence deployment.
    Also, there are script available in the community to add or remove a device from a collection, see for example:
    http://sccmfaq.wordpress.com/2013/05/20/sccm-2012-sp1-remove-client-from-collection-after-osd/
    Keep in mind that if you want to use a script like that during the task sequence that the device running the task sequence (and by that the script) requires specific rights within ConfigMgr.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Call Task Sequence at the end of a task sequence

    Hi
    I have SCCM 2012 R2 with many task sequence.
    It's possible at the end to task sequence to call another task sequence? If yes, do you a link to explain that?
    Thanks

    The TechNet documentation has the bascis:
    https://technet.microsoft.com/en-us/library/hh846237.aspx#BKMK_InstallApplication (expand Details).
    You simply need to populate the task sequence variables with the values corresponding to the applications or packages you want to install. This can be done in a variety of methods including directly assigning them to a collection or device, using a script,
    or the built-in set task sequence variable step.
    It all depends on how the task sequence is informed which path to take.
    Jason | http://blog.configmgrftw.com | @jasonsandys

Maybe you are looking for