OSD - Task Sequence to run powershell script

Hello,
I'm building up an image with OSD and will be layering some components to meet our needs with some powershell scripts. At the moment we will not have this device add itself to the domain so it'll be in a workgroup. The scripts are on a share that everyone has
read access to. Should I add a task sequence that will map a drive letter with domain credentials and have the task sequence call the script from that drive letter?

That is possible to do, but why would you not create a package/application with the script and let it download and run locally? 
Daniel Ratliff | http://www.PotentEngineer.com

Similar Messages

  • 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

  • Whats the best way to apply office updates during OSD task sequence with Software Update Agent disabled?

    I am trying to update office via the SCCM 2012 R2 OSD task sequence. I know offline updating only updates the core components in the WIM and I'm trying to figure out how to add office updates as well. I am aware of using powershell to try and kick off
    a WU scan as seen here:
    http://myitforum.com/myitforumwp/2012/01/24/use-powershell-commands-to-assist-with-patching-during-sccm-image-build/
    But the kicker is we don't use SCCM to update the workstations (Solo WSUS install). Is there a way to do this (maybe set the client in the TS to switch on SUP, then off again when it goes off into production) rather than have to build a new image every month?

    You could use the ZTI_WindowsUpdates.wsf script from MDT.
    http://scriptimus.wordpress.com/2012/03/22/mdt-2012-automating-updates-in-lite-touch-deployments/
    How does it work?
    The task sequence steps run a script called ZTIWindowsUpdate.wsf. The script uses the
    Windows Update Agent API to manage the downloading and installation of updates. All audit information is written to the
    ZTIWindowsUpdate.log file. If you find any unusual error codes in your log returned from the API (although I never have)  you can compare the codes
    here. The script will also check and update the
    Windows Update Agent(WUA) as needed at the start.
    In its default state, the ZTIWindowsUpdate.wsf script will connect to Microsoft Update then search for and download all available updates including Security Patches, Drivers, Browser Updates and Service Packs. This is essentially the same
    as opening the GUI and selecting check for updates.
    Daniel Ratliff | http://www.PotentEngineer.com

  • Prompt for AD Description OSD Task Sequence

    Hello,
    I want to be prompted for AD Description while OSD Task Sequence, tried couple of scripts from different blogs but couldn't got any result. Need help from your side.
    Thanks
    REGARDS DANISH DANIE

    The setting which are described in this blog i have deployed on Test Task Sequence but that didnt work for me in that sense that its doesnt Prompt for Description while installation.
    "http://ccmexec.com/2012/01/set-computer-description-during-osd/"
    While in the second blog writer already said that "description does not filter back to AD it only remains local to the machine" So i want that description in AD.
    What i want... a script that prompt for description are changes made on AD in computer account description.
    Hope you have got my point? 
    REGARDS DANISH DANIE

  • Run Powershell Script task sequence

    Hi,
    Anyone have good documentation on how to use the Run PowerShell Script task sequence ?
    Thanks

    If you are just interested in running a powershell command without creating a package, you can do this with the the Command line step by using this format in the command line:
    PowerShell -ExecutionPolicy bypass -Command "& {your powershell commands}"
    Here is an example of a multiline command to increase the agents cache size. Notice the ";"'s which are used to delineate a new line.
    PowerShell -ExecutionPolicy bypass -Command "& {$UIResourceM gr = New-Object -ComObject UIResource.UIResourceMgr;$Cache = $UIResourceMgr.GetC acheInfo();$Cache.TotalSize = "20480"}"

  • Passing parameters with spaces to SCCM Run PowerShell Script task

    I am working on an OS deployment task sequence in SCCM 2012 R2 with several Run PowerShell Script tasks.  Most of them run fine, but I am having trouble with the one I need to pass parameters to.
    The parameters I need to pass are:
    -ComputerOU "ou=All Workstations,dc=contoso,dc=com" -GroupDN "cn=Group1,ou=All Groups,dc=contoso,dc=com"
    I have that line (with actual DNs) entered in Parameters of the task.
    But when the script runs on the target machine, the values of the parameters in the script are truncated at the spaces.  $ComputerOU is set to "ou=All" and $GroupDN is set to "cn=Group1,ou=all"
    What syntax should I be using the Parameters field of the Task in order to properly pass PowerShell parameter string values that include spaces?
    Tim Curwick
    MadWithPowerShell.com

    Thank you, TC, but I am not calling the parameters from within PowerShell.
    The parameters are in the settings of a task sequence task to be used by the task to launch a script.  The syntax I am using would be correct for use within PowerShell or from a command line or batch script, but SCCM appears to be doing some parsing
    before or while it is passing them to the script, possibly dropping the quotes which causes mishandling of the spaces in the string values.
    Historically, it is always challenging to give one application parameters to pass to another application, and the required syntax can get quite tricky when the two application handle quotes or spaces differently, or when the parent application wants to parse
    something intended to be passed on as is to the child application.
    I'm sure someone has already figured out what the syntax needs to be for doing this with an SCCM 'Run PowerShell Script" task, it's just one of those issues that is hard to Google effectively.
    Any other ideas?
    Tim Curwick
    MadWithPowerShell.com

  • PXE OSD Task Sequence fails to run on new laptop

    We are trying to run a working PXE OSD task sequence on a new HP laptop.  It's a Elitebook 840 G2.  We've downloaded the provided driver package & created a new driver package in SCCM.  We inserted the driver into the boot image &
    updated the DPs.  When we PXE boot the laptop it flashes the splash screen & reboots.  Other laptops & desktops boot properly.  This looks like a driver issue but we wanted to run it past the forum to see if anyone had any other suggestions.
     The SMSTS log file is copied below.
    LOGGING: Finalize process ID set to 728
    TSBootShell
    4/23/2015 4:20:40 PM
    732 (0x02DC)
    ==============================[ TSBootShell.exe ]==============================
    TSBootShell 4/23/2015 4:20:40 PM
    732 (0x02DC)
    Succeeded loading resource DLL 'X:\sms\bin\i386\1033\TSRES.DLL'
    TSBootShell 4/23/2015 4:20:40 PM
    732 (0x02DC)
    Debug shell is enabled TSBootShell
    4/23/2015 4:20:40 PM 732 (0x02DC)
    Waiting for PNP initialization... TSBootShell
    4/23/2015 4:20:40 PM 736 (0x02E0)
    RAM Disk Boot Path: NET(0)\SMSIMAGES\ALN00001\BOOT.ALN00001.WIM
    TSBootShell 4/23/2015 4:20:40 PM
    736 (0x02E0)
    Booted from network (PXE) TSBootShell
    4/23/2015 4:20:40 PM 736 (0x02E0)
    Network(PXE) path: X:\sms\data\ TSBootShell
    4/23/2015 4:20:40 PM 736 (0x02E0)
    Found config path X:\sms\data\ TSBootShell
    4/23/2015 4:20:40 PM 736 (0x02E0)
    Booting from removable media, not restoring bootloaders on hard drive
    TSBootShell 4/23/2015 4:20:40 PM
    736 (0x02E0)
    X:\sms\data\WinPE does not exist. TSBootShell
    4/23/2015 4:20:40 PM 736 (0x02E0)
    X:\_SmsTsWinPE\WinPE does not exist. TSBootShell
    4/23/2015 4:20:40 PM 736 (0x02E0)
    Executing command line: wpeinit.exe -winpe TSBootShell
    4/23/2015 4:20:40 PM 736 (0x02E0)
    Executing command line: X:\WINDOWS\system32\cmd.exe /k
    TSBootShell 4/23/2015 4:20:40 PM
    732 (0x02DC)
    The command completed successfully. TSBootShell
    4/23/2015 4:20:40 PM 732 (0x02DC)
    Successfully launched command shell. TSBootShell
    4/23/2015 4:20:40 PM 732 (0x02DC)
    Executing command line: X:\WINDOWS\system32\cmd.exe /k
    TSBootShell 4/23/2015 4:20:41 PM
    732 (0x02DC)
    The command completed successfully. TSBootShell
    4/23/2015 4:20:41 PM 732 (0x02DC)
    Successfully launched command shell. TSBootShell
    4/23/2015 4:20:41 PM 732 (0x02DC)
    Executing command line: X:\WINDOWS\system32\cmd.exe /k
    TSBootShell 4/23/2015 4:20:41 PM
    732 (0x02DC)
    The command completed successfully. TSBootShell
    4/23/2015 4:20:41 PM 732 (0x02DC)
    Successfully launched command shell. TSBootShell
    4/23/2015 4:20:41 PM 732 (0x02DC)
    The command completed successfully. TSBootShell
    4/23/2015 4:20:43 PM 736 (0x02E0)
    Starting DNS client service. TSBootShell
    4/23/2015 4:20:43 PM 736 (0x02E0)
    Executing command line: X:\sms\bin\i386\TsmBootstrap.exe /env:WinPE /configpath:X:\sms\data\
    TSBootShell 4/23/2015 4:20:44 PM
    736 (0x02E0)
    The command completed successfully. TSBootShell
    4/23/2015 4:20:44 PM 736 (0x02E0)
    ==============================[ TSMBootStrap.exe ]==============================
    TSMBootstrap 4/23/2015 4:20:44 PM
    1124 (0x0464)
    Command line: X:\sms\bin\i386\TsmBootstrap.exe /env:WinPE /configpath:X:\sms\data\
    TSMBootstrap 4/23/2015 4:20:44 PM
    1124 (0x0464)
    Succeeded loading resource DLL 'X:\sms\bin\i386\1033\TSRES.DLL'
    TSMBootstrap 4/23/2015 4:20:44 PM
    1124 (0x0464)
    Succeeded loading resource DLL 'X:\sms\bin\i386\TSRESNLC.DLL'
    TSMBootstrap 4/23/2015 4:20:44 PM
    1124 (0x0464)
    Current OS version is 6.2.9200.0 TSMBootstrap
    4/23/2015 4:20:44 PM 1124 (0x0464)
    Adding SMS bin folder "X:\sms\bin\i386" to the system environment PATH
    TSMBootstrap 4/23/2015 4:20:44 PM
    1124 (0x0464)
    PXE Boot with Root = X:\ TSMBootstrap
    4/23/2015 4:20:44 PM 1124 (0x0464)
    Executing from PXE in WinPE TSMBootstrap
    4/23/2015 4:20:44 PM 1124 (0x0464)
    Loading TsPxe.dll from X:\sms\bin\i386\TsPxe.dll
    TSMBootstrap 4/23/2015 4:20:44 PM
    1124 (0x0464)
    TsPxe.dll loaded TSPxe
    4/23/2015 4:20:44 PM 1124 (0x0464)
    Device has PXE booted TSPxe
    4/23/2015 4:20:44 PM 1124 (0x0464)
    Variable Path: \SMSTemp\2015.04.22.16.21.10.0001.{8EBA05A2-1AB7-4CBB-9DDD-497DFE8E5E07}.boot.var
    TSPxe 4/23/2015 4:20:44 PM
    1124 (0x0464)
    Succesfully added firewall rule for Tftp TSPxe
    4/23/2015 4:20:44 PM 1124 (0x0464)
    Executing: X:\sms\bin\i386\smstftp.exe -i 172.20.100.51 get \SMSTemp\2015.04.22.16.21.10.0001.{8EBA05A2-1AB7-4CBB-9DDD-497DFE8E5E07}.boot.var X:\sms\data\variables.dat
    TSPxe 4/23/2015 4:20:44 PM
    1124 (0x0464)
    Command line for extension .exe is "%1" %*
    TSPxe 4/23/2015 4:20:44 PM
    1124 (0x0464)
    Set command line: "X:\sms\bin\i386\smstftp.exe" -i 172.20.100.51 get \SMSTemp\2015.04.22.16.21.10.0001.{8EBA05A2-1AB7-4CBB-9DDD-497DFE8E5E07}.boot.var X:\sms\data\variables.dat
    TSPxe 4/23/2015 4:20:44 PM
    1124 (0x0464)
    Executing command line: "X:\sms\bin\i386\smstftp.exe" -i 172.20.100.51 get \SMSTemp\2015.04.22.16.21.10.0001.{8EBA05A2-1AB7-4CBB-9DDD-497DFE8E5E07}.boot.var X:\sms\data\variables.dat
    TSPxe 4/23/2015 4:20:44 PM
    1124 (0x0464)
    Process completed with exit code 1 TSPxe
    4/23/2015 4:21:31 PM 1124 (0x0464)
    Succesfully removed firewall rule for Tftp TSPxe
    4/23/2015 4:21:31 PM 1124 (0x0464)
    uExitCode == 0, HRESULT=80004005 (e:\nts_sccm_release\sms\server\pxe\tspxe\tspxe.cpp,185)
    TSPxe 4/23/2015 4:21:31 PM
    1124 (0x0464)
    Failed to download pxe variable file. Code(0x00000001)
    TSPxe 4/23/2015 4:21:31 PM
    1124 (0x0464)
    PxeGetPxeData failed with 0x80004005
    TSPxe 4/23/2015 4:21:31 PM
    1124 (0x0464)
    HRESULT_FROM_WIN32(dwError), HRESULT=80004005 (e:\nts_sccm_release\sms\client\tasksequence\tsmbootstrap\tsmbootstraputil.cpp,1459)
    TSPxe 4/23/2015 4:21:31 PM
    1124 (0x0464)
    TSMBootstrapUtil::PxeGetPxeData(&bPxeBooted, sVariablesFile, sPxePasswd), HRESULT=80004005 (e:\nts_sccm_release\sms\client\tasksequence\tsmbootstrap\tsmediawizardcontrol.cpp,2667)
    TSPxe 4/23/2015 4:21:31 PM
    1124 (0x0464)
    oTSMediaWizardControl.Run( sMediaRoot, true, sTSLaunchMode ), HRESULT=80004005 (e:\nts_sccm_release\sms\client\tasksequence\tsmbootstrap\tsmbootstrap.cpp,1078)
    TSPxe 4/23/2015 4:21:31 PM
    1124 (0x0464)
    Execute( eExecutionEnv, sConfigPath, sTSXMLFile, uBootCount, &uExitCode ), HRESULT=80004005 (e:\nts_sccm_release\sms\client\tasksequence\tsmbootstrap\tsmbootstrap.cpp,1226)
    TSPxe 4/23/2015 4:21:31 PM
    1124 (0x0464)
    Exiting with return code 0x80004005 TSPxe
    4/23/2015 4:21:31 PM 1124 (0x0464)
    hMap != 0, HRESULT=80070002 (e:\nts_sccm_release\sms\framework\tscore\environmentscope.cpp,493)
    TSPxe 4/23/2015 4:21:31 PM
    1124 (0x0464)
    m_pGlobalScope->open(), HRESULT=80070002 (e:\nts_sccm_release\sms\framework\tscore\environmentlib.cpp,335)
    TSPxe 4/23/2015 4:21:31 PM
    1124 (0x0464)
    this->open(), HRESULT=80070002 (e:\nts_sccm_release\sms\framework\tscore\environmentlib.cpp,553)
    TSPxe 4/23/2015 4:21:31 PM
    1124 (0x0464)
    Execution complete. TSBootShell
    4/23/2015 4:21:31 PM 736 (0x02E0)
    hMap != 0, HRESULT=80070002 (e:\nts_sccm_release\sms\framework\tscore\environmentscope.cpp,493)
    TSBootShell 4/23/2015 4:21:31 PM
    736 (0x02E0)
    m_pGlobalScope->open(), HRESULT=80070002 (e:\nts_sccm_release\sms\framework\tscore\environmentlib.cpp,335)
    TSBootShell 4/23/2015 4:21:31 PM
    736 (0x02E0)
    this->open(), HRESULT=80070002 (e:\nts_sccm_release\sms\framework\tscore\environmentlib.cpp,553)
    TSBootShell 4/23/2015 4:21:31 PM
    736 (0x02E0)
    ::RegOpenKeyExW (HKEY_LOCAL_MACHINE, sKey.c_str(), 0, KEY_READ, &hSubKey), HRESULT=80070002 (e:\nts_sccm_release\sms\framework\tscore\utils.cpp,809)
    TSBootShell 4/23/2015 4:21:31 PM
    736 (0x02E0)
    RegOpenKeyExW is unsuccessful for Software\Microsoft\SMS\Task Sequence
    TSBootShell 4/23/2015 4:21:31 PM
    736 (0x02E0)
    GetTsRegValue() is unsuccessful. 0x80070002.
    TSBootShell 4/23/2015 4:21:31 PM
    736 (0x02E0)
    End program: TSBootShell
    4/23/2015 4:21:31 PM 736 (0x02E0)
    Finalizing logging from process 728 TSBootShell
    4/23/2015 4:21:31 PM 736 (0x02E0)
    Finalizing logs to root of first available drive
    TSBootShell 4/23/2015 4:21:31 PM
    736 (0x02E0)
    LOGGING: Setting log directory to "D:\SMSTSLog".
    TSBootShell 4/23/2015 4:21:31 PM
    736 (0x02E0)

    Press F8 in order to get a cmd window and see if the client got an IP address.
    Torsten Meringer | 
    There's no IP Address when trying to the command prompt. It doesn't even show a MAC Address.

  • USMT Capture Doesn't Run on "Required" OSD Task Sequences?

    Hello,
    I have a strange issue with USMT and my OSD Task Sequence. I'm upgrading Windows XP to Windows 7 Enterprise via in-place upgrade with SCCM 2012 SP1 integrated with MDT. My TS runs 100% perfectly if I deploy the TS to my collection, make it "Available,"
    and run it from the Software Center. All configured profiles get copied and restored using hardlinks as expected.
    When I create a "Required" deployment, however, and let it run on it's own, the USMT never runs and I lose all profile information as a result of the drive format. The rest of the TS runs as expected, but as I said, the USMT (scanstate.exe) won't
    run. There are no discernible errors in the SMSTS.log file. I see where it processes my TS variable (OSDMigrateAdditionalCaptureOptions) and where it processes the "Capture User State" step, but scanstate.exe never kicks off or creates a log file. 
    Am I missing something here? Is this expected behavior? I can't find documentation on this, at least not yet. I have reproduced this exact behavior three times now, and I'm out of ideas.
    Snippet of log from working, "Available" deployment:
    Parsing step node: Capture User State
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    Description: Tue 02/04/2014 9:09:06 AM
    260 (0x0104)
    ContinueOnError: Tue 02/04/2014 9:09:06 AM
    260 (0x0104)
    SuccessCodeList: 0 Tue 02/04/2014 9:09:06 AM
    260 (0x0104)
    (__hrMethodRetVal == ((HRESULT)0L)) || (bFailIfMissing == false), HRESULT=80070002 (e:\NTS_SCCM_RELEASE\sms\common\inc\ccmxml.h,582)
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    No condition is associated with the step.
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    Disable: Tue 02/04/2014 9:09:06 AM
    260 (0x0104)
    Run in attribute: FullOS Tue 02/04/2014 9:09:06 AM
    260 (0x0104)
    Timeout: Tue 02/04/2014 9:09:06 AM
    260 (0x0104)
    DefaultVarlist found Tue 02/04/2014 9:09:06 AM
    260 (0x0104)
    Variable name: OSDMigrateContinueOnLockedFiles
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    Variable name: OSDMigrateEnableVerboseLogging
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    Variable name: OSDMigrateFileAccess
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    Variable name: OSDMigrateMode Tue 02/04/2014 9:09:06 AM
    260 (0x0104)
    Variable name: _OSDMigrateOfflineUserState
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    Variable name: OSDMigrateSkipEncryptedFiles
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    Variable name: _OSDMigrateUseHardlinks
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    Variable name: _OSDMigrateUsmtPackageID
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    Action command line: osdmigrateuserstate.exe /collect /continueOnError:%OSDMigrateContinueOnLockedFiles% /skipefs:%OSDMigrateSkipEncryptedFiles%
    Tue 02/04/2014 9:09:06 AM 260 (0x0104)
    Adding instruction at 23 Tue 02/04/2014 9:09:06 AM
    260 (0x0104)
    ***Shortly after the above step runs, the Scanstate.exe runs and creates a log file
    Snippet from non-working, "Required" deployment:
    Parsing step node: Set OSDMigrateAdditionalCaptureOptions
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Description: Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    ContinueOnError: Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    SuccessCodeList: 0 Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    (__hrMethodRetVal == ((HRESULT)0L)) || (bFailIfMissing == false), HRESULT=80070002 (e:\NTS_SCCM_RELEASE\sms\common\inc\ccmxml.h,582)
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    No condition is associated with the step.
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Disable: Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    Run in attribute: WinPEandFullOS Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    Timeout: Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    DefaultVarlist found Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    No variables found in default variable list
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Action command line: tsenv.exe "OSDMigrateAdditionalCaptureOptions=/uel:30 /ue:*"
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Adding instruction at 23 Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    Parsing step node: Capture User State
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Description: Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    ContinueOnError: Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    SuccessCodeList: 0 Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    (__hrMethodRetVal == ((HRESULT)0L)) || (bFailIfMissing == false), HRESULT=80070002 (e:\NTS_SCCM_RELEASE\sms\common\inc\ccmxml.h,582)
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    No condition is associated with the step.
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Disable: Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    Run in attribute: FullOS Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    Timeout: Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    DefaultVarlist found Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    Variable name: OSDMigrateContinueOnLockedFiles
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Variable name: OSDMigrateEnableVerboseLogging
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Variable name: OSDMigrateFileAccess
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Variable name: OSDMigrateMode Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    Variable name: _OSDMigrateOfflineUserState
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Variable name: OSDMigrateSkipEncryptedFiles
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Variable name: _OSDMigrateUseHardlinks
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Variable name: _OSDMigrateUsmtPackageID
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Action command line: osdmigrateuserstate.exe /collect /continueOnError:%OSDMigrateContinueOnLockedFiles% /skipefs:%OSDMigrateSkipEncryptedFiles%
    Tue 02/04/2014 9:25:41 AM 2024 (0x07E8)
    Adding instruction at 24 Tue 02/04/2014 9:25:41 AM
    2024 (0x07E8)
    Any thoughts or advice would be appreciated. This can be done using "Available," but having to log in to each machine in order to kick-off the TS via Software Center seems inefficient.

    My deployments have the same settings (except the ones that change when going from Available to Required, of course), so that doesn't appear to be the culprit. I re-examined my Capture User State step, and it looks fine, but I'll post my settings just in
    case I'm missing something. I can't post the screen capture here for some reason, so below is an outline of my settings:
    Package for User State Migration Tool: (My USMT package is listed here)
    Capture all user profiles by using standard options is selected
    Verbose Logging is OFF
    Skip files using EFS is OFF
    Copy by using file system access is selected
    Continue if some files cannot be captured is ON
    Capture locally by using links instead of by copying files is OFF
    Capture off-line mode (Windows PE Only) is OFF
    Capture by using VSS is not selected
    Image is hosted at: imgur (dot) com / RnGyF8d - I can't post links until verified...

  • Cant get 2013 data base AdminPassword= to work in OSD task sequence

    I'm using the MDT database to consolidate five windows 7 task sequences on five SCCM2007 site servers to one task sequence on one 2012 R2 site server. I got my locations by ip subnet working and most of the settings applied successfully, Join Domain, add 
    a group to the local  admin group, but I can't seem to get the AdminPassword=MyPassword to work.
    I've got an "apply windows settings" step in my task sequence. But the machine keeps getting what ever its password is set to.
    If I leave it bland then I get a blank password etc.. If I run without the "apply windows settings" step then then the task sequence fails and finishes with a mini setup prompting for a computer name. I can see the other values that are collected
    in the Bdd.log:
    Remapping variables.
    Property OSDDomainName is now = My.Domain
    <Message containing password has been suppressed>
    I even tried adding the default setting directly to the customsettings.ini file: AdminPassword=MyPassword. But the workstation still takes its password from the "apply windows step". I'm going to try and enable debug logging and see if the log
    has anything about the local admin password. Anyone have any ideas? What am I doing wrong here?
    [Settings]
    Priority=LSettings, LAdmins,
    [Default]
    OSInstall=Y
    SkipCapture=YES
    SkipAdminPassword=NO
    SkipProductKey=NO
    SkipComputerBackup=YES
     SkipBitLocker=YES

    I wrote\borrowed\modified a powershell script that gets the value of the base 64 encoded AdminPassword variable from the MDTDB, decodes it and applys it to the OSDLocalAdminPassword.
    This runs after the gather step in my OSD task sequence and before the Apply Windows Settings step.
    I never figured out why this was necessary but it works. Here is the power shell script if anyone has a similar problem:
     http://blogs.technet.com/b/mniehaus/archive/2009/09/22/running-powershell-scripts-as-part-of-a-task-sequence.aspx
     http://mylifeismymessage.net/base64-encodeddecode-functions-powershell/
    Function Base64Decode($textBase64In)
        $b  = [System.Convert]::FromBase64String($textBase64In)
        $decoded = [System.Text.Encoding]::UTF8.GetString($b)
        return $decoded
    $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
    $password = $tsenv.Value("AdminPassword")
    $base64out = Base64Decode($password)
    $tsenv.Value("OSDLocalAdminPassword") = $base64out

  • Changing the Task Sequence Deployment Options via script

    Hi all,
    I am fairly new to SCCM 2012 scripting/SDK and couldn't find any helpful examples how to change the deployment options of task sequences by using a script.
    The problem is: we have got a significant number of TS that have the deployments set to "Download content locally when needed by running task sequence".
    I have to change this setting to "Download all content locally before starting task sequence".
    Afterwards I need to create a list of all changed TS Deployment options and also a list of current settings of all TS Deployment options.
    Therefore I would need a script that can read and set this particular option of the TS.
    Does anybody have a script that can do such tasks? Any help is highly appreciated.
    Btw, I am not picky, I can handle WMI, SQL, VBS, PowerShell, .Net Code (vb.net or c#). Whatever you have handy would be quite helpful.
    Many thanks
    Amir

    Hi,
    The Set-CMTaskSequence -DeploymentOption could help you change this setting.
    Set-CMTaskSequence
    Best Regards,
    Joyce Li
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • 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.

  • Creative Cloud: "Build" MSI Hangs During SCCM OSD Task Sequence Installation

    I wanted to share problem and solution I found when deploying Creative Cloud Packager-created packages/application using SCCM 2012 R2.  I encountered this problem packaging this as both a Package and as an Application in SCCM.
    When installing the software through SCCM Software Center onto a client, Software Center would close right as the installation of the "Build" folder MSI completed.  This is abnormal behavior.
    When installing the application as part of an OSD Task Sequence, the software would get installed (as shown by logs) but SCCM would hang forever at the "Installing Application" step.
    I tried all sorts of different settings in SCCM and with the MSIEXEC command line and eventually traced it to the Reboot Manager functionality in MSIEXEC that will close and attempt to restart processes using files that the installer needs. Reboot Manager clobbered part of SCCM and in the Task Sequence, the connection between SCCM and the installer was broken.
    The solution is to pass the property "MSIRESTARTMANAGERCONTROL=Disable" along the command line when calling MSIEXEC on the Build folder MSI file.  This setting disabled Restart Manager so it didn't mess up SCCM.  Once I did this, my Software Center installs and OSD Task Sequences ran as intended.
    For reference, I used the REBOOT=ReallySuppress property for reboots and let SCCM determine what to do with reboots based on the return code.  My testing was done with Windows 8.1 Enterprise x64.

    Like said, did you configure my proposal: "Configuration Manager client will force a mandatory device
    restart" ? After you've configured that, update your deployment type manually and remove the old revisions of the application and try running the TS again. I'm guessing you're a little bit too fast on your doings so the ConfigMgr doesn't play a long very
    nicely...
    The TS stops because of your Hard Reboot (exit code 1641), I've seen this before and I configured my application so that ConfigMgr client will force device restart and that fixed my problem. Although, also my application is the last one in the TS, but still,
    the TS continues after the reboot.
    Btw. have you tried changing your command line to:
    msiexec.exe /i cd-ord.msi TRANSFORMS=sv-se.mst MVLICENSE_KEY=xxxxxxxxxxxxxxxxx /L*V "%temp%\cdord.log" /qn
    /norestart

  • UDI OSD Task Sequences started failing with 0x80070002 error in SCCM 2012

    This is kind of long, but here goes...
    We built a UDI task sequence in SCCM 2012 (with MDT integration) that we were testing for deployment of a couple of different Win7 images.  We customized the UDI experience thru the UDI wizard and XML file and OS deployment worked as expected
    thru the task sequence (testing on Hyper-V VMs). Recently, this UDI TS started failing with error 0x80070002  during what appears to be the "Use Toolkit Package" step.  This is after the OS image has already been laid down and after the ConfigMgr
    client has been installed/configured.  The SMSTS.log reports "Failed to open the task sequence key HKLM\Software\Microsoft\SMS\Task Sequence.  Error code 0x8007002"  Among other errors...I will post the entire log below...
    After the error during deployment, Win7 will boot normally, however, you have no network connectivity and it appears the proper network driver didn't get loaded in the OS. Combine this with the fact that the TS should have joined the machine to our domain,
    but you can't login because no network.. Im not sure if the network issue is a product of the TS failing early or the actual cause of the TS failure. 
    Anyway, I attempted to build another UDI task sequence using the same boot image and toolkit/settings packages, but am experiencing the same error during deployment.  We have a few OSD task sequences built without UDI and those all still work just fine. 
    So, I am at a loss for where the root problem lies.  Any suggestions or assistance would be greatly appreciated.
    Here is the entire SMSTS.log and BDD.log...
    https://skydrive.live.com/redir?resid=D65B1C4362892A26!110&authkey=!AKu5mOvDsXaEgvc
    Thanks
    Richie Tenhet

    your failure does appear to be network (driver or otherwise) or dns related and it cannot contact the management point FQDN just around the time where it should download and execute the
    Use Toolkit Package step...
    "Starting Task Sequence Engine . . . "
    "Non fatal error 0x80072ee7 in sending task sequence execution status message to MP"
    "Start executing an instruciton. Instruction name: Use Toolkit Package. Instruction pointer: 83"
    "unknown host (gethostbyname failed)"
    "sending with winhttp failed; 80072ee7"
    "Tried all the available http based locations. SMB based locations will be attempted now."
    "Failed to resolve the source for SMS PKGID=P0100015, hr=0x80070002"
    "Failed to run the action: Use Toolkit Package.
    The system cannot find the file specified. (Error: 80070002; Source: Windows)"
    that said, check that the package referenced above actually exists and is the correct source version on your distribution points, also verify (press F8 and check can you ping the FQDN of your management point) that you have network connectivity
    around the time of the failure.
    Step by Step Configuration Manager Guides >
    2012 Guides |
    2007 Guides | I'm on Twitter > ncbrady

  • Auto Login as part of OSD Task Sequence

    Hi,
    I am wondering if there is a way to force a Login with a specified account to Windows as part of an OSD.  I have an command in the registry in HKEY Local Machine...../RunOnce that needs to run before the end user uses their computer. 
     Unfortunatly, it just will not run as part of a "Run Command Line" Task. 
    I can accomlish this by using the GUIUNATTEND AutoLogon in Sysprep, but that also presents some challenges.  If there was a way in the OSD Task Sequence that I could force a login with a specified account and then logout, that would be great.
    Thanks
    Rosy_55

    The code (vb) below would be created into a step as an application installation or package installation as the second to last step, the last step would be to reboot into the default OS.  
    This will, during OSD set a autologin account to login until rebooted, once done the last step will reboot and log into windows, the runonce section will then run gpupdate, and then restart the machine.
     It will only login once.  Modify as needed.
    Note that you need to modify the sUsername = "domain\user", and sPassword = "domainuserpassword"
    variables.
    CODE:
    'after autologin this sets the computer to run gpupdate one time and then reboot
    Set objShell = WScript.CreateObject("WScript.Shell")
    strRunOnce = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce\joinDomain"
    objShell.RegWrite strRunOnce, "cmd /k gpupdate "&chr(38)&chr(38)&"shutdown -r -f -t 10", "REG_SZ"
    'this configures the autologin
    Const HKEY_CLASSES_ROOT = &h80000000
    Const HKEY_CURRENT_USER = &h80000001
    Const HKEY_LOCAL_MACHINE = &h80000002
    Const HKEY_USERS = &h80000003
    Const HKEY_CURRENT_CONFIG= &h80000005
    Const HKEY_DYN_DATA = &h80000006
    sUsername = "domain\user"
    sPassword = "domainuserpassword"
    Set objNetwork = CreateObject("Wscript.Network")
    sComputer = objNetwork.ComputerName
    strRegKey = "Software\Microsoft\Windows NT\CurrentVersion\Winlogon\"
    Write64BitRegistry "REG_SZ", HKEY_LOCAL_MACHINE, strRegKey, "AutoAdminLogon", "1"
    Write64BitRegistry "REG_SZ", HKEY_LOCAL_MACHINE, strRegKey, "DefaultUserName", sUsername
    Write64BitRegistry "REG_SZ", HKEY_LOCAL_MACHINE, strRegKey, "DefaultDomainName", strComputer
    Write64BitRegistry "REG_SZ", HKEY_LOCAL_MACHINE, strRegKey, "DefaultPassword", sPassword
    Write64BitRegistry "REG_SZ", HKEY_LOCAL_MACHINE, strRegKey, "ForceAutoLogon", 1
    Write64BitRegistry "REG_DWORD", HKEY_LOCAL_MACHINE, strRegKey, "AutoLogonCount", 1
    Sub Write64BitRegistry (strRegType, strRootKey, strKey, strValueName, strValue)
    Dim objCtx, objLocator, objReg, intReturnCode
    Set objCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
    objCtx.Add "__ProviderArchitecture", 64
    Set objLocator = CreateObject("Wbemscripting.SWbemLocator")
    Set objReg = objLocator.ConnectServer("", "root\default", "", "", , , , objCtx).Get("StdRegProv")
    If Ucase(strRegType) = "KEY" Then
    intReturnCode = objReg.CreateKey(strRootKey,strKey)
    End If
    If Ucase(strRegType) = "REG_DWORD" Then
    intReturnCode = objReg.SetDWORDValue(strRootKey,strKey,strValueName,strValue)
    End If
    If Ucase(strRegType) = "REG_SZ" Then
    intReturnCode = objReg.SetStringValue(strRootKey,strKey,strValueName,strValue)
    End If
    If Ucase(strRegType) = "REG_EXPAND_SZ" Then
    intReturnCode = objReg.SetExpandedStringValue(strRootKey,strKey,strValueName,strValue)
    End If
    If Not intReturnCode = 0 Then
    End If
    End Sub
    William Lee

  • Non-Deployed Applications in OSD Task Sequence Are Deployed To Collection Members where OSD TS is deployed

    Hello,
    I have a situation where an application (which is not deployed) that is part of an OSD Task Sequence is being deployed to computers that are in the same collection my TS for OSD is deployed.
    For OSD I have created an application to check the BIOS version and upgrade the BIOS if there is a newer one available. The application has numerous deployment types (13) due to various hardware models and the requirement to go to several intermediary BIOS
    versions to reach the current newest version. There are dependencies configured to handle these incremental bumps.
    The OSD TS is deployed to a collection that contains all windows desktop class operating systems. What I have seen happen once is that one users workstation somehow discovered and installed the BIOS Upgrade package and their BIOS was upgraded on their workstation.
    I've checked the logs on several other machines and this same application has been run as well.
    The application is configured "Allow this application to be installed from the Install Applications
    task sequence action without being deployed" which allows it to be ran from a TS even though it is not deployed.
    I have verified the application is not deployed. I have verified there are no superceedence rules configured. As I stated, there are dependencies, but all dependencies are within this one application.
    What I do not understand is, how can an application that is not
    deployed and is only referenced in an Operating System Deployment Task Sequence able to be ran outside the task sequence?
    This is/has occurred with computers imaged with cm2012 and with computers imaged with cm2007 who have now been migrated to cm2012.
    I'm fairly sure that it is due to the task sequence and where it is advertised. Computers that are not in this collection do not show the application being applied in the AppEnforce.log. If it is the TS that is causing this, how can something that is designed
    to be a "sequence of tasks", allow something to occur out of that sequence?
    Current environment is CM2012R2.
    Any thoughts to what might be happening?
    Thanks

    Hello,
    After working with Microsoft Support, we were able to resolve the issue.
    Turns out there was something (old policies) "stuck" in the SCCM database that was causing this to be advertised outside the task sequence and not visible on the console. While they didn't call this "a bug" since it has happens with CM2007 as well, it definitely
    was not normal behavior. Still not sure how that could happen as I'm 99.99% sure I never deployed this to any collection, but that's what they said.
    It took several hours of support rooting through the database to figure out what was going on but after some SQL magic it was fixed. Sorry I don't have more specifics regarding the fix. MS basically said "If it happens again you can do this this and this
    in the db and voila its fixed". Since I'm likely to cause more damage (messing with the database) then good if it were to happen again I'd contact them.
    Anyway, this odd behavior has spooked me and I've reverted back to deploying the TS to the unknown computer collection. As much as it disappoints me to take a step back and cause more work for the guys doing the imaging, the extra safety this grants (if
    something like this or worse were to happen) I think is better than an OSD task sequence gone wild.
    Thanks,
    Mark

Maybe you are looking for