Move SCCM client to another OU at the end of the deployment task sequence

Hi
I'm looking to modify my SCCM task sequence so that it can put a computer in the correct OU at the end of provisioning. I've come across a couple of scripts to do this, but neither are working at the moment
1. A few lines of PowerShell here (http://stackoverflow.com/questions/22966037/move-computer-to-new-ou-in-sccm-2012-task-sequence-with-powershell)
C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -command iex \" `$TargetOU=\"\"OU=TargetOUName,DC=ConglomiCo,DC=com\"\"; `$SysInfo=New-Object -ComObject \"\"ADSystemInfo\"\";`$ComputerDN=`$SysInfo.GetType().InvokeMember(\"\"ComputerName\"\",\"\"GetProperty\"\",`$Null,`$SysInfo,`$Null);`$Computer=[ADSI]\"\"LDAP://`$ComputerDN\"\";`$OU=[ADSI]\"\"LDAP://`$TargetOU\"\";`$Computer.psbase.MoveTo(`$OU);"
With the above command, I keep on receiving a syntax error and/or invalid OU error. My specified OU is valid and I'm using an account with sufficient permissions to move computers in AD. I also find the syntax with the "\" difficult to follow.
2. The second script I've tried here, doesn't seem to work either:
http://blog.coretech.dk/jgs/vbscript-move-computer-object-to-another-ou-via-command-line-parameter/
On Error Resume Next
'Get MachineObjectOU Value
Set wshNetwork = CreateObject("WScript.Network")
Set oFso = CreateObject("Scripting.FileSystemObject")
Set objSysInfo = CreateObject( "ADSystemInfo" )
Set ArgObj = WScript.Arguments
'Use first argument as target OU
strMachineObjectOU = strLDAPofOU
strComputerDN = objSysInfo.ComputerName
'msgbox(strMachineObjectOU)
nComma = InStr(strComputerDN,",")
strCurrentOU = Mid(strComputerDN,nComma+1)
strComputerName = Left(strComputerDN,nComma - 1)
'msgbox(strCurrentOU)
'If current ou is different than target OU. Move object
If UCase(strCurrentOU) <> UCase(strMachineObjectOU) Then
    Set objNewOU = GetObject("LDAP://" & strMachineObjectOU)
    Set objMoveComputer = objNewOU.MoveHere("LDAP://" & strComputerDN, strComputerName)
    'msgbox("LDAP://" & strComputerDN & strComputerName)
End If
If I put this script into a task sequence, how does SCCM know which computer to move in AD? I'm assuming by using variable strComputerDN = objSysInfo.ComputerName
Thanks in advance
IT Support/Everything

If I put this script into a task sequence, how does SCCM know which computer to move in AD? I'm assuming by using variable strComputerDN = objSysInfo.ComputerName
Correct. Jörgen did a post about the usage of that script a long time ago that should help you, see:
http://ccmexec.com/2010/12/move-computer-to-the-correct-ou-during-deployment/
My Blog: http://www.petervanderwoude.nl/
Follow me on twitter: pvanderwoude

Similar Messages

  • Deploy Task Sequence to VPN based clients

    Can task sequences be deployed to VPN based clients? Its not an OSD task sequence, the task sequence in question has a couple of program installs and relatively small in size.
    The client machine(s) do receive the deployment although the status deployment remains on "Downloading", so I assume the device cannot locate the content on the DP within the VPN (configured Slow) boundary.
    The packages in the custom TS are located on the DP, so its either the boundary or a task sequence configuration.
    Just to note - Software updates are deploy successfully to VPN based clients within the same boundary, so I'm inclined to say it might be the task sequence?
    Any suggestions?
    Thanks
    Craig
    MCTS | MCITP | MCSA

    Thanks - although where is this configuration in the program/package(s):
    "Check the packages/programs called in the TS to ensure they are correctly set for slow-link behaviour."
    Oops, sorry, it's on the deployment;
    Step 10. here:
    http://technet.microsoft.com/en-us/library/gg682178.aspx
    On the Distribution Points page of the Wizard, specify the following information:
    Deployment options – Specify the actions that a client should take to run program content. You can specify behavior when the client is in a fast network boundary, or a slow or unreliable network boundary.
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • How to use two different boot images in the same task sequence

    I have a need to use Two boot images in the same task sequence. The reason is I'm deploying ZTI to McAfee encrypted devices which I have already done with McAfee v6 Encryption successfully.
    Here's where my problem comes in. We are about to deploy McAfee v7 which means we will have a mix of v6 and v7 in our environment. I must have two special Boot images one with v6 drivers and one with v7 drivers in order for my process to work. I don't see
    a way right now to assign more than one boot image to a task sequence. Is there any way to do this?
    If I can't do that then I will have to create two task sequences and target collections based on the Endpoint Encryption version to deploy to.
    If anyone has suggestions it would be much appreciated. Thank you

    Have you tested copying those files to %windir%\system32\drivers during the WinPE session (just enable commandline support to your boot image) to see if they need to be in there before the OS start? Test that and if they don't need to be there during the
    boot up of WinPE then:
    Create two packages (v6 and v7)
    "Run command line", use the package created earlier and just use "copy /Y .\*.* %windir%\system32\drivers" ...again, this should be run according to your needs, variable or some other check like I said

  • Cool code to move a region to another spot on the page.  HELP-doesn't email

    I am moving a region from one place to another on a page.... putting it in the middle of a report.
    I mentioned it here :
    documentation on html_GetElement, and moving a regionID via javascript
    Why am I doing this? I needed to see one purchase order, with the POitems in the middle of the page. So i render the purchase order (using a custom report template I built)... in that template, I Have a div called POItems. Then in a separate region, I'm getting the POitems using an APEX report region. After the page is loaded, i call a js function I wrote to move the contents of the region from whereever it is to the div where I've saved a place for that data in the middle of my larger purchase order report.
    It looks GREAT!!!
    Here is the function (i have it in the HTML Header of the page)
    (I know, i hardcoded the regionID. I'm going to change it later to grab the id into a field and then use that field's value to make the function more generic. I'll also add parameters to specify the name of the region I wanna get, and the name of the DIV I wanna move it to, and I'll rename the function to moveRegion)
    function movePOItems(){
    var o = html_GetElement('R199099409321783582');
    if (o){
    var oDIV = getObject('POitems');
    if (oDIV){
    oDIV.innerHTML = o.innerHTML;
    o.style.display = "none";
    and I call it in the footer:
    <script language="JavaScript" type="text/javascript">
    movePOItems();
    </script>
    Now, the problem. The whole purpose for this was to PRINT and to EMAIL. Print preview looks fine (haven't printed to paper yet). Looks really great! What we are using to print is Internet Explorer's (ver 6.x) "File/Send/Page by Email". When I go to print, the POItems region shows up where it would have shown up had I not moved it then hidden it!! It's as if I never wrote the function and never called it.
    I'm guessing that Outlook doesn't do the javascript calls.
    Any ideas?
    If you don't need to print, I hope someone can use this trick! Really, though, I hope to resolve the printing issue or I have to totally rewrite the sql query to get the items. I thought I was done w/ this task! :-(
    ~Darby
    Versions:
    Outlook 2003 SP2
    IE: 6
    Apex: 2.2
    Oracle: 10g

    thanks Tyler but I have to go with the software and versions that we have.
    I am actually done w/ that task.
    I wrote a pl/sql procedure to get the poItems inline and it looks really good.
    It's a good lesson learned that you can't use any fancy javascript after page load, if you wanna use File\Send\Page byEmail (IE).

  • Update the result to client (JAVA code) aftere completing the user task

    Hi All,
    I have a simple workflow activity with in my BPEL process .
    FLOW is like this:
    1)----->Initiate/Process
    2)----->Workflow user task
    3)Approve/Reject /Others
    4)If APPROVE a call to web-service method
    5)reply
    If i got the out put as approve the next step is a call to web-service which should give the output to client(JAVA code).
    Is the above senario possible through BPEL.
    Thanks,
    Kalyan.

    HI ALL
    I fixed this problem. Problem was because of classpath. After setting the path of class file in classpath, issue was fixed.
    Regards
    Arun

  • 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

  • My SCCM Client does not show all the tabs in the Config manager control pannel

    Hi All,
    I have a issue Post pushing a installation on a client. It was installed successfully. But i do not get all the options in the control panel as per the below screenshot.
    I reinstalled the client via push from the console during the re installation i got the below errors as per the below screenshot.
    Can any one tell me why is this issue happening.
    I get all the options in my SCCM DP / Site server control panel but not in the client.
    I got the DP role re installed, As well as well as checked the DNS. Iam able to ping from my client machine to the Site server / DP via ip as well as FQDN.
    Can any one please help?
    Gautam.75801

    Got the solution.
    1. Reconfigure the boundary and boundary groups and rebooted the SCCM DP / Site server.
    2. Turn firewall off in the client and uninstall the SCCM setup in the client and Rebooted the client and re install the client via push method from console
    3. Turned off the UAC in the client machine.
    Now i am able to get all the tabs s well as Console shows the server as a client.
    Gautam.75801

  • SCCM Client not installing after imaging the computer. Where to start?

    Hi,
    When I image or re-image a new machine, it will finish successfully but the client will be set to "NO" regardless of how many days I leave it there.
    We delete the machine name both on SCCM and Active Directory prior to any image deployment.  Therefore, the imaging process is treated as new.  Autodiscovery is also enabled except for Network Discovery which we never enabled ever.
    We are running SCCM 2012 SP1.  Windows 7 both 32 and 64 bit.
    If we install the client manually on the workstations, it is fine but it has to be automatic on the server side.
    Pls. help.  Thanks!

    You are right on.  Thank you thank you!  The client is stuck in provisining mode.  This helped me understand the cause of the problem. 
    However, the solution of setting the provision from true to false in the registry, didn't change the "client install" status from No to Yes.  Also, the restart option is already set to the default operating system...
    So  what I did (and currently testing right now) is disabled the restart option to see if that's the reason it is getting messed up. 
    Will follow up shortly.

  • Trying to use a button to move form data to another section of the document

    Not sure how to form this question, but hoping you guys (the experts) will be able to help me along....
    I'm trying to setup a form that, when you select a button it moves data like below:
    and then will move it to the correct section as indicated by which button you pressed:
    Is this possible? Any help you can provide would be very appreciated! Thanks in advance.

    Alright - so I've been trying to work w/the scripting language (I'm sorry, I'm fairly new, and one of two things happens whenever I enter it in.
    1. The text disappears from the box on the right and doesn't show up in the assigned boxes.
    2. Nothing happens
    I've attached a photo (below) of the script as my ignorant self believes it should look. Any thoughts? (Again, I appreciate your patience here - thanks!):

  • Why can not I call the Sysprep on the MDT Task sequence created ?

    Good afternoon gentlemen,
    Please help me !
    I'm days trying to unravel this problem , any task that I create and call on the relevant equipment, is the right procedure for all steps and ends with the successfully completed task window, nothing happens.
    In this last task created to capture image , returns no error and a window appears that says successfully completed the task , the more it turns out he does not call the Sysprep and not capture any images.
    It must be some detail I'm leaving aside , most happens that I followed a couple videos I'm doing the same with me and not working .
    Anyway I do not know what to do and I need help from someone who already has experience in this tool.
    Thank you in advance thanks.
    Paul R Pecke .

    Thank you my friend , was the day trying to solve this problem and thanks to your tip I could solve.
    I am very grateful for your help.
    Goodbye, good week .hugsPaulo R Pecke.

  • Deploy Images with SCCM Client Installed

    Hi everyone.
    there's one thing I have in mind for a while and haven't got a solution for it
    We use SCCM 2012 to build and create our master image with a Task Sequence
    one task before the syspreping is  "prepare configuration manager client", which from my understanding and from technet - resets all the client's unique configuration.
    conclusion - the SCCM Client is installed and "Syspreped" on our base image
    in that case, assuming we still use the same SCCM client version, is there a way to save time during the Deploy task sequence?
    the "Setup windows and ConfigMgr" step is required and it installs the SCCM Client all over again, even though it is already included in our master image.
    thanks
    Tamir Levy

    First, as noted by Daniel, the Setup Windows and ConfigMgr task does much more than simply installing the ConfigMgr agent. This is clearly indicated by the name of the task (before the "and") "Setup Windows".
    The are no true advantages to having the client agent in the image. If you are building your image with ConfigMgr though, it is unavoidable. Yes having it in the image should save time by not having to reinstall the pre-reqs -- most are pretty trivial though
    but you may gain a bit although I can't say I've ever timed it.
    There is no time savings to be had here, the client agent must be either installed or re-installed during the deployment TS, this is unavoidable. You'll need to look elsewhere if this is a required goal.
    Jason | http://blog.configmgrftw.com | @jasonsandys

  • Deploying the SCCM 2012 Client to WES 7 devices that are locked down with the FBWF using 2007 task sequence via WEDM.

    I'm wondering how people are migrating their embedded devices that are using the FBWF. I've done some googling and it seems like most people are just re-imaging the devices and after migrating a single device i see why. Its not a pretty process. This will
    be a long description but ultimately my question stems more from trying to find a better way to execute the device migration from 2007 to 2012.
    Some back ground on my situation might be in order here. I'm in the process of wrapping up our 2007 to 2012 migration. We have a 2007 infrastructure that was a central server with 2 primaries and 286 secondary site servers. I've consolidated that to a single
    2012 primary site server that hosts all the main roles. There are 2 more servers in the data centers both operating solely as push distribution points I'll refer to them as 2012 01 02 and 03. I'm over half way through the migration and so far haven't needed
    to offload any site roles. There are almost 10,000 clients now reporting to the 2012 site server and almost a 100 field servers pulling content from 2012 02 as their source dp as pull dp is the only way forward for this many devices. I've read the horror stories
    of trying spin up 200 plus push dps. We are running PKI. I'm at the point now where i need to start migrating the Windows Embedded Seven Standard clients that have the 2007 sccm client on them with WEDM for write filter handling.
    What i'm wondering is if anyone has any pointers for me regarding migrating the WES 7 devices. My plan that i've come up with is to somehow script the process using a 2007 WEDM Task Sequence to try and migrate them over to 2012. Things are complicated as
    I need to somehow script the install, the policy checkin, hardware inventory, software inventory, and validate the SCEP client installs before I reboot the device one last time to enable the FBWF. How I handled the SCCM 2007 client install on these devices
    when they were provisioned was to just create a batch file that would sleep for ten minutes then check to see if the inventoryagent.log file had been created yet. I realize now that is inefficient as i can kick off the inventory using a WMI method once the
    client has installed. Also I need to make sure the machine gets its first policy as that is how it creates the communication using PKI through that first policy transfer and that also finalizes the client install. The biggest piece i'm uncertain about in this
    regard is the SCEP client.
    I had to change the SCEP client install from yes to no in the default client settings as we have some Mcaffee servers that can't have the SCEP client on them. I have incremental updates enabled on the collection that has the policy that installs the SCEP
    client but this will take an unknown amount of time unless i force the environment to update as the device starts in 2012 install, or if I could kick off the SCEP isntall... IDK. I'm also wondering if i should keep the device in the migration process until
    i validate it has its proper scep policy applied which I believe can be validated by a registry key somewhere.
    Once the 2012 client gets installed will that cause it to lose its place within the 2007 Task Sequence? Considering its going to take a minimum of 2 reboots I'd normally use the task sequence to handle its progression through the process.
    I'm also considering trying to use an Orchestrator runbook, as that would be a good way to keep track of the migration process as each device migrates. Especially since this might take several seperate scripts.
    I'm going to take a stab at scripting the migration process, but if anyone has any pointers that might make this a less complicated I'd really appreciate it as I've got about 3000 of these devices that need to be migrated over. The other things i've learned
    the hard way is any time you have something this complicated over the course of 3000 devices you will run into unknowns and the failure rate increases. I'm in the precarious position of having to not only build this process out but in some situations have
    it complete in the shortest amount of time possible as we have sites running 24x7. I know the end users behavior all to well and they will just keep hitting the power button sometimes even though their not supposed to so they can get their device functional
    again. In those situations i'd end up, if i'm lucky with a device that no longer has a healthy SCCM client in either environment and the write filter disabled.
    So like i said any pointers anyone could throw my way i'd really appreciate. I manually went through the migration process on a single device for proof of concept and ended up with almost 2 pages of pseudo code for my migration script/scripts.
    Thanks,
    -K.R.

    Hi,
    In R2 there are some new variables you can use to solve this,
    http://ccmexec.com/2014/12/smstsmplistrequesttimeout-value-in-milliseconds/
    In Sp1 though adding a step to sleep for 2-5 minuter after reboot and before the application install step is a common workaround.. a powershell command with "Start-Sleep
    -s 120" should do it. 
    /Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • Why the SCCM client always corrupts the WMI repository?

    Hi All,
    I have a Configuration Manager 2012 R2 CU2 installation with hundred of client/servers.
    From the initial deploy of the SCCM client, we seen that many machines had a Windows slow logon process.
    We searched online for a fix and many people had this problem, suggesting to enable a registry key called
    HKLM\Software\Microsoft\CCM\Ccmeval\NotifyOnly.
    From that date, we fixed the slow logon process problem, but still have problems with operating system's updates installed with SCCM.
    In the most cases, when SCCM install updates, it corrupt the WMI database and at the OS reboot, the updates are rolled back.
    On the same machines, if we install updates from Windows Updates, we have no problems.
    Also, with SCCM installation, we see a lot of "DCOM" or "PerfLib" errors.
    Usually, the remote management of a client with SCCM doesn't works because the WMI repository is corrupted, so each time we need to do uninstall the SCCM client and do this:
    1. Disable and stop the WMI service.
         sc config winmgmt start= disabled
         net stop winmgmt
    2. Run the following commands.
         Winmgmt /salvagerepository %windir%\System32\wbem      (I noticed that you have run this command, but I would suggest that you try it again)
         Winmgmt /resetrepository %windir%\System32\wbem
    4. Re-enable the WMI service and then reboot the server to see how it goes.
         sc config winmgmt start= auto
    This is very frustrating.
    Why the SCCM client create all these problems and how to fix this?
    Thanks for your support.

    I think that my case is not isolate.
    There are a lot of posts like this:
    http://www.windows-noob.com/forums/index.php?/topic/8989-wmi-corruption-sccm-2012-win7-sp1/
    http://trevorsullivan.net/2012/11/21/configmgr-2012-ccmeval-exe-causing-client-corruption/
    The strange thing is that the WMI corruptions only happens on machine where the SCCM client is installed, even if the machines is without any additional software (fresh windows installation).
    In the same time, I need to fix a ProfSvc bug (KB2617858) because the PC become unusable.
    Also, why it starts a WMI rebuild if I deploy the client with the "NotifyOnly" option (the registry key is fine)?
    So, basically, on a fresh windows machine, as it joins to the domain:
    1) the SCCM client install itselfs
    2) it starts to install several windows updates
    3) at the first restart, it try to rebuild the WMI and the ProfSvc bug appears
    May be that the problem is not the SCCM client itself, but a windows update deployed via SCCM client?

  • Problem installing SCCM client in remote untrusted forest

    Hi,
    My configuration is :
    My network is in two parts : intranet and a DMZ. In the DMZ there is another forest and domain. There is no trust between the forest in the DMZ and the internal network. I configured the remote forest in SCCM with a user account that has Domain Admin acces
    in the DMZ forest/domain.
    The primary site server is located in the internal part of my network. SQL is installed on a remote server. Management point, distribution point, Fallback Status Point roles are installed on the primary site server. SMS Provider is installed on the primary
    site server.
    In the DMZ part, I have a management point, distribution point installed on one server.
    The forest discovery works fine. I can query AD in the remote forest (DMZ).
    I have a problem installing the SCCM client on computers located in the remote forest with client push or with the command line.
    CCMSETUP.EXE /MP:DMZ site server /DP:DMZ site server /FSP: primary site server SMSSITECODE:SIT
    In CCMSetup.log I can see that the client try to communicate with my DMZ site server but it reverts to the management point and distribution point located in the internal part of the network. The installation fails and will try in 10 minutes.
    Do anyone has seen this problem before? Am I missing something? Could it be a configuration issue?
    Could you help me whit this please?
    Thanks in advance for your time!
    Jacques

    Does the client installation work when you install the client manually on the untrusted domain client? What does the CCM.log say on the site server?
    Have you double checked the firewall ports for the client push installation? The ports needed for the client push to work are as follows (from the site server to the client):
    SMB - TCP 445
    RPC Endpoint Mapper - TCP 135 / UDP 135
    RPC Dynamic Ports
    And to Management Point:
    HTTP - TCP 80 (When using HTTP)
    HTTPS - TCP 443 (When using HTTPS)
    Also a quote from
    TechNet: "In addition to the ports listed in the following table, client push installation also uses Internet Control Message Protocol (ICMP) echo request messages from the site server to the client computer to confirm whether the client
    computer is available on the network. ICMP is sometimes referred to as TCP/IP ping commands. ICMP does not have a UDP or TCP protocol number, and so it is not listed in the following table. However, any intervening network devices, such as firewalls, must
    permit ICMP traffic for client push installation to succeed."

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

Maybe you are looking for