Recently when packaging Microsoft Dynamics SL 2011 (8.1) I encountered a bizarre problem. The program simply wouldn’t install via the Managed Installation, the program wanted to run as the local user and simply refused to install as the account that the KACE Managed installations use. To top it off, a bat file I was running to map a network drive produced an error, where the network drive would be accessible, but would report itself as a “Disconnected Network Drive” I was unable to disconnect the drive and it required a restart to get it to disappear.

      These problems confounded me as whenever I ran the install.bat locally it would run like a charm, uninstalling the old version 7 and installing the new version 8. I did research, googled various answers, nothing worked. But I refused to let this problem stop my package, as we were days away from a large deployment I couldn’t let it fail. I ended up crawling through the maze of files and folders the previous K2000 admin had left, I found his old Solomon package, it used numerous AutoIT scripts and presented a lot of activity on the end users screen, I was worried because I prefer to not have that type of end user experience. I noticed something odd, in all the folders, scripts, and repackaged executables; there was one that stood out: “RunAsCurrentUser.exe”. At first I thought this was something that he had repackaged, as something with such a simple name couldn’t be what I needed could it? Turns out? It was.

      RunAsCurrentUser.exe when ran in front of the setup.exe forced the setup to run as that of the user logged in, not as the KACE Managed Install user. As you may be aware, there is a feature in the scripts to run the script as the current user in the console, on the pc, a different user, the local system (I believe this is the one Managed Installs uses). But no such option exists for managed installs. Now with this program you’re able to force the installs to perform themselves as the user logged into the computer. I had one last problem, the network mapping bat file wouldn’t run. It always set the drive to the disconnected state. So, after I turned it into an executable, I managed to make the network drives map as well when I ran the new executable with the RunAsCurrentUser executable! The deployment came and went, while not free of a couple hiccups, our users were all up and running perfectly before lunch! The package is a silent experience for end users and everyone is happy.

      So remember, if your package seems perfect, runs great on your test machines, but just doesn’t work in KACE Managed Installations, give it a try with RunAsCurrentUser.exe –w in front and it just might come to life!