We recently updated to K2000 version 3.6 and system image deployments are working fine except the last Post Install Task, "Cleanup" Never completes. In the task details it says "In Progress". These system image deployments worked with 3.5, but of course this task did not exist in 3.5 nor did the Task Engine.

Basic tasks are to Partition, Format, Remove DPinst reboot, then the post install tasks is just to Rename Computer, install Kace agent, and join domain called from a batch file (with a reboot and autologon between each step). It is convenient to have the computers automatically rename from a list, etc. I've also tried adding 1 or 2 Ksleep after the task. In 3.5 it was the same, but the last step was to remove the Kace folder, etc. manually after joining the domain (no Kcleanup).

Now, it does successfully rename, install agent and join domain and reboot, but it just stays on Cleanup in progress forever.The image is completely usable even though it's stuck on cleanup.

If I remove the manual delete of the Kace folder from the bat file then it does NOT remove the Kace folder with the Cleaup either so cleanup does not apperar to be working either.

Any ideas how to get the cleanup to complete successfully or how to remove it from the Task engine tasks?

Thanks

 

6 Comments   [ + ] Show Comments

Comments

  • the new cleanup is a vbs file that calls cmd /c start /wait c:\kcleanup.exe at the end. Does that file exist? can you run it manually?
  • The Kcleanup is in C:\ and I can manually run it, but the details still shows the task as "in progress".
    I'm thinking it may be a timing issue?

    The Rename PC-install agent-join domain task is run from one task that calls a bat file that uses wsname, sets the registry to run install agent, reboots then installs the agent, sets the registry to run join domain, reboots, joins the domain, and reboots.
    It is probably trying to run the Cleanup during a reboot or is rebooting too quickly before it gets a chance to run. I tried 2-3 Ksleeps, but still a no go.

    Maybe I should split it into 3 separate tasks to rename, then install agent, then join domain or is there an easier way to do this?

    Can I rename the PC and install the agent without a boot in between or will that pass the wrongly named PC?

    Thanks
    • do you have the machine auto log into the domain after it joins? I do have it login and my cleanup run and completes ok. The only big difference I see with what you are doing is naming it in the post tasks, I name mine in the mid level tasks. Try running the wsname as the first post task, reboot. I have one post task any more, no reboots.

      net start w32time

      %SystemRoot%\system32\w32tm /config /update /manualpeerlist:tmccacad.tmcc.edu /syncfromflags:manual

      start /wait net user administrator /active:yes
      start /wait net localgroup administrators f14master /add
      Start /wait net user administrator password

      reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoAdminLogon /d 1 /f
      reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoLogonCount /t REG_DWORD /d 3 /f
      reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultDomainName /d tmccacad /f
      reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultUserName /d installer /f
      reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultPassWord /d password /f
      reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Enviroment" /v LSFORCEHOST /d ms-vdf.tmccacad.tmcc.edu /f
      reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon" /v Userinit /d "C:\Windows\system32\KUsrInit.exe," /f

      del C:\Users\Default\AppData\Local\Microsoft\Windows\webcache\*.* /f /q
      del C:\Users\Default\AppData\Local\Microsoft\Windows\*.log1 /f /q /a:hs
      del C:\Users\Default\AppData\Local\Microsoft\Windows\*.log2 /f /q /a:hs
      del C:\Users\Default\AppData\Local\Microsoft\Windows\*.blf /f /q /a:hs
      del C:\Users\Default\AppData\Local\Microsoft\Windows\*.regtrans-ms /f /q /a:hs
      del C:\Users\Default\AppData\Local\Microsoft\Windows\Explorer\*.* /f /q
      del c:\users\default\downloads\*.* /f /q /s

      "C:\Program Files\Microsoft Office\Office15\ospprearm.exe"
      cscript "c:\program files\microsoft office\office15\ospp.vbs" /act
      cscript %SystemRoot%\System32\slmgr.vbs -ATO

      start /wait msiexec /qn /i "\\10.16.19.27\client\agent_provisioning\windows_platform\ampagent-5.5.30275-x86.msi" HOST=kbox.tmcc.edu

      start /wait cscript.exe c:\windows\w2d\join_domain.vbs tmccacad.tmcc.edu domaininstaller password

      Start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background" /v OEMBackground /t REG_DWORD /d 1 /f

      start /wait reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v ipv6kill /d "reg.exe add \"HKLM\SYSTEM\CurrentControlSet\services\Tcpip6\Parameters\" /v DisabledComponents /t REG_DWORD /d 4294967295 /f"

      net user installer /delete

      reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v setrunonce2 /d "reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v setrunonce1 /d \"reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v policyon /d c:\windows\w2d\policy.bat\""
      • Thanks, I like your post install task and may incorporate some of it's ideas into ours. You're right that it's not very different from what we are doing except for the reboots. I haven't tried renaming during the mid-level task and may try that. Other than possible timing issues since mine is currently a bat file calling 3 other bat files after reboots, It seems the important difference is that I reboot after the domain join at the end to bring the PC ready for use. And it is NOT logged ON as admin when the kCleanup runs. How do you end the post install tasks with a reboot to the logon screen after everything is completed if the task engine wants to throw a Kcleanup after that?
      • In the sysprep I have it use a local user to autologon then the post task switches it to autologon as a domain user. 3.6 reboots for me after the post task to run the kcleanup. In the post task I set it to join the domain and switch the autologin to a domain user acct with 3 logins. In reality we only get 2 reboots as a user since the kcleanup eats one.
      • Pretty much the same for us. It is set in the answerfile to autologon and autologs on in the post task as the local admin to rename, install agent etc.
        But after it Joins the domain I don't have any further tasks so my script disables autologon and reboots to the logon screen for the students to use.
        In version 3.6 Cleanup runs as part of the Task engine so I don't have any control over it (when and if to run it, whether to reboot after). If it did I could just add one autologon for that and have it reboot after the Cleanup or if it were possible to add a reboot after the cleanup. But, It just runs automatically after the last task with no options.
        Maybe if I give it more time before it restarts with the shutdown /r /t after the domain Join it can run before it restarts.
        Oh and I did try separating out the rename PC, install agent, and Join Domain out as separate tasks with the same results but if I don't restart after the domain join Cleanup DID successfully run and complete.
        Unfortunately, it also did not restart the PC after so it just left it logged on as local admin.
        More testing I guess...
      • Okay, so I did get the Cleanup to work.
        I split it into 3 post-install tasks.
        1) It Renames the PC using wsname and a dat file and box is checked to reboot.
        2) It installs the Kace agent
        3) It Joins the domain and just a few simple manual cleanup things and shutdown /r /t 60 so that it has time to run Cleanup before it reboots.
        This works and on the PC being re-imaged it shows in the task engine that all tasks have completed, but on the server it shows install Kace agent as "in progress" and the rest "Waiting" so the info wasn't passed back to the server for the agent install.
        I think the problem is that it runs the rename and for some reason runs the install agent task BEFORE it reboots from the rename task which really shouldn't happen with the task engine and the box checked to reboot after renaming.
        I suppose a Ksleep would resolve that.
        Smal, you mentioned you rename as a mid level task. Is there a way to use wsname with a dat file as a mid-level task? We have all our PCs in a dat file and add new PCs to the list before deploying.
        It would probably solve this new problem and have one less reboot too which would be a bonus.
        Thanks.
      • the last line of my post task does not run till after the cleanup because of the way I poke the command to the run once. You should be able to use that line and replace the policy.bat with the shutdown /r /t 60 command and that will cause a reboot after the kcleanup runs

        reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v setrunonce1 /d \"reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v RestartSystem /d shutdown /r /t 60"
      • Not sure if you can use wsname as a mid task. I would give it try. I use the get/apply computer name since we reimage 2 times a year for all the academic systems. For the new systems we get in I leave the computername out of the sysprep answer file so if I do not use the apply name it prompts for it. Inputting the name is the only additional work our students workers need to do for new machines, which they can do a 30 machine classroom in 5 minutes.
      • I don't know if you saw my last post, but it is running all the way through now including Cleanup. It runs the Cleanup after joining the domain, but before the shutdown /r /t 60. So everything works, but the server task engine stays stuck at whatever task I have after Rename PC whether it is Install agent or a Ksleep.
        you mentioned you rename as a mid level task. Is there a way to use wsname with a dat file as a mid-level task? We have all our PCs in a dat file and add new PCs to the list before deploying.
        It would probably solve this new problem and have one less reboot too which would be a bonus.
        Thanks.
      • It's just so strange...
        The rename task is just wsname.exe /RDF:ComputerNames.dat /DFK:$MAC in the commandline and reboot box checked.
        Kace shouldn't run the next task "Install agent" until after it has rebooted.
  • It's a system image so it only has that one post install task, but because it is a task that renames from a computer.dat file, then installs the agent, then joins the domain Kace will run the initial bat file task and then just go to the next task BEFORE it has completed it's 3 individual tasks and rebooted 3 times. This means it can start running the next task in the middle of the other 3 tasks.

    After it joins the domain it reboots, but doesn't autologon because it is the last task.
    It should have time to do the cleanup before it reboots after joining the domain though.

    I may do the rename, agent, and join domain as 3 separate tasks to avoid the timing issues. It didn't have any problems in 3.4 because KCleanup didn't run.
  • Make sure that your .bat file contains the appropriate commands for running all the items before rebooting. So if you rename with wsname, make sure to put start /wait wsname.exe /option.
    More details would help
  • Hi and Thanks for the help. The 1 post install task is working fine actually. It's getting stuck on Cleanup.
    My understanding from Kace is that Start/wait, call etc. are no longer supported with version 3.6. I guess I could use start/wait within the bat file though if that would matter??? I'm not sure if Kace would "wait" when called this way. Now, what Kace does is call the bat file (which contains 3 bat files and 3 reboots) and imediately goes to the next task which is I why I tried 3 ksleeps.
    After the task to rename, install the agent and join the domain the PCs reboot to CTL-ALT-DEL and are ready to be used. I'll include the task details below.

    We have only one Post-install task for student system images and that is to run a Start.bat file from a zipped folder with what is needed for below. It’s worked with K2000 3.5 and below and it works fine in 3.6 , except after it runs Cleanup just hangs on “in progress”. I’ve also removed the rd Kace folder line since that is part of what cleanup does.
    Start.Bat
    xcopy /S /E /I source c:\source
    c:\source\1_wsname_x86.bat
    1_wsname_x86.bat
    c:\source\wsname.exe /RDF:c:\source\ComputerNames.dat /DFK:$MAC
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d Username /f
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d Password /f
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d localhost /f
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v V1 /t REG_SZ /d "CMD /C \"C:\source\2_KAgentInstall_x86.bat\"" /f
    shutdown -r -t 3
    2_KAgentInstall_x86.bat
    msiexec.exe /i "c:\source\ampagent-5.5.30275-x86.msi" /qn HOST=nwkbox.nwcc.commnet.edu

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d Username /f
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d Password /f
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d localhost /f

    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v V1 /t REG_SZ /d "CMD /C \"C:\source\3_JoinDomain_x86.bat\"" /f

    shutdown -r -t 15

    3_JoinDomain_x86.bat
    ping 127.0.0.1 -n 5

    Call CMD /C rd /s /q C:\AnswerFile\
    Call CMD /C rd /s /q C:\kace\

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d Username /f
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d Password /f
    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /t REG_SZ /d localhost /f


    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v V1 /t REG_SZ /d "CMD /C \"rd /s /q C:\source\"" /f


    C:\source\Join_Domain.vbs nwcc.commnet.edu Username Password 155.43.192.81


    shutdown -r -t 30

    I'm wondering if that last Kcleanup is failing because it happens during or is interrupted by a reboot or if it needs admin rights to run. If it runs before the last reboot it will have admin rights, but if it actually runs after then there is no autologon since I'm done after joining the domain and it wouldn't have rights. So, it may be timing issues or the lack of admin rights.

    Oh, and I've started breaking that 1 task into 3 separate tasks to eliminate "timing" issues, so only 1 reboot per post-install task. I'll also try adding a reboot with autologon as admin although I don't want the PCs to be left logged on as admin for their last boot for obvious reasons.

    Thanks for any input!
  • Telling the image to Prompt on Errors for some reason lets it say it completed successfully on the server as well as the PC even though it does not ever prompt me for any errors. Strange, but it works. With it set to continue on errors the task engine on the PC completes everything successfully and on the server it says In progress on whatever task is after the wsname task.

    Seems like imaging takes twice as long with version 3.6 though. It's up to 16 to 19 minutes now instead of 8 to 10.
Please log in to comment

There are no answers at this time

Answers

Answer this question or Comment on this question for clarity