By Garth Jones
I do a lot of testing with PsExec because I need this tool to simulate exactly how System Center 2012 Configuration Manager (CM12) and CM07 install / run applications.
Recently, while I was doing some testing, I needed to run PsExec on one of my new servers, but I noticed that it was not installed. In order to install PsExec, I wanted to use CM12’s application model, but PsExec does NOT have a MSI file to install. It simply has an .exe file in a zip file. In lieu of a MSI file, I created a script installation application for PsExec.
If you’re ever in a similar situation, follow these steps:
First, create a registry key to use with your detection method.[HKEY_LOCAL_MACHINE\SOFTWARE\Enhansoft\Tools]“PSExec”=”Installed”
Then create a batch file to install PsExec and place it with the unzipped source files.
copy %~dps0*.* %windir%\system32
regedit /s psexec.reg
regedit /s ES_Flag.reg
Now, in the CM12 console, click on the Create Application button in the Software Library node.
Select the “Manually specify the application information” option. Click on Next.
Fill in the details about your application and click on Next.
Fill in the details in this dialogue box and then click on Next.
Select Script Installer and then click on Next.
Enter the source location and the batch file information and then click on Next.
Click Add Clause….
Change the Setting Type to Registry and select the registry key. In my case, in order to test the full functionality I also enabled, “This registry setting must satisfy the following rule to indicate the presence of this application,” and used “Equals” with Operator and typed in “Installed” for Value. Next, click OK and then click on Next.
Change the options as required and click on Summary.
Click on Next.
Click on Summary.
Click on Next and then click on Close.
That’s all there is to it and PsExec should install shortly. Treat this application script just as you would any other application deployment. I assigned this to my All Desktop and Server Clients collection.
Afterwards, I started thinking about how else this script installation application could be used, for example with BgInfo!