K2000 3.6 Post Install Task Cleanup Never completes for System image-- In Progress
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
Answers (0)
Be the first to answer this question
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 - Geoff25 10 years ago
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\"" - SMal.tmcc 10 years ago
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... - Geoff25 10 years ago
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. - Geoff25 10 years ago
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" - SMal.tmcc 10 years ago
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. - Geoff25 10 years ago
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. - Geoff25 10 years ago
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. - Geoff25 10 years ago
More details would help - cserrins 10 years ago
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! - Geoff25 10 years ago
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. - Geoff25 10 years ago