Removing local Administrator Account after Imageinstallation
Hello ITNinja Community,
we are using the K2000 and a Scripted Installation to perform our windows imageinstallations. The Scripted Installation uses a local admin account which gets created during the image installation. We would like to remove this local account after the installation is finished. For that I created a Powershell script and a corresponding post installation task. The powershell script logs out all users and removes the administrator account. The problem is, that the scripted installation wont get finished after running the script. It seems like the local admin account is required in order to complete the installation. Is there any way to complete the installation upon removing the account?
Thanks in advance
Answers (3)
The full cleanout is done by this account so it is not possible to remove it while the deployment.
Keep in mind, that all Post Install Tasks are running with the freshly installed OS, so do not do this in a Mid Level Task!
You can set as last task a task which copies a batch file which deletes the user and the user folder to the system and a task which sets HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce to run this file. Then it will run first time the system boots up after deoloyment and clean out.
Comments:
-
Hello Nico, for your information. I solved this issue by creating a scheduled task during a post installation task. This scheduled task runs at the next reboot and deletes the user. The scheduled task gets deleted after it ran.
Your suggestion wouldnt have worked because that registry key only takes affect after an administrator account is logged in. - FelixF 10 months ago