Now, before you get all upset, this is really a prototype to demonstrate ONE possible way to do something which isn’t normally supported (use at your own risk, batteries not included).
So, the point here is that Microsoft Intune is a flexible, and capable tool, even if it has some hair-brained management consoles to contend with. But it is somewhat limited on how it can deploy software to a Windows desktop device (or laptop, tablet. not talking phones here). You can deploy an .appx, .msi or .exe file, and that’s about it.
With ConfigMgr, on the other hand, you can deploy almost anything, probably including a kitchen sink with dishes and stinky water, if you wanted to. So…
One common challenge in the crazy world of software deployment is having to deploy things other than packaged applications. For example, Access database files, raw data files, creating folders and shoving files into them, creating custom shortcuts, and so on. Granted, much of this can be done using other means (AdminStudio repackaging, InstallShield packaging, and even Group Policy, to name a few). But this is only a demonstration and not intended to be a recommendation for how to do things. I’m showing one particular wrench, so if you prefer a hammer, use a hammer.
Deploy a copy of the beloved CMTrace.exe log viewer to a Windows machine, using Intune. Place the exe into a designated folder. Create a desktop shortcut to the exe for all users.
Three (3) files in all: install.bat, install.vbs and the CMTrace.exe file. CMTrace.exe is included with System Center Configuration Manager server installations, and can be found under the “tools” sub-folder below the main installation path. Be sure you are properly licensed for ConfigMgr before you start copying any of its files around.
(ignore “InstallCMTrace.exe” for now. I’ll explain that one later)
I used a Windows 10 Professional computer, and the ancient (and still included with Windows) iexpress.exe packager utility. Okay, it’s not really a packager, but if you drink enough you can pretend it is.
Script 1 – Install.bat
@echo off set log=%temp%\intune_cmtrace.log echo info: moving cmgtrace.exe to c:\users\public\documents... >%log% move %~dp0CMTrace.exe C:\Users\Public\Documents\ if exist "c:\users\public\documents\cmtrace.exe" ( echo info: file moved successfully. >>%log% goto GOOD ) else ( echo error: file was not moved! >>%log% goto END ) :GOOD echo info: calling script to create shortcut... >>%log% cscript /nologo install.vbs >>%log% echo info: finished processing. >>%log% goto END :END
Script 2- Install.vbs
Sub MakeShortcut(caption, target, wpath, icon, wintype, tip, where) Dim objShortcut, objShell Set objShell = CreateObject("WScript.Shell") If where <> "" Then wscript.echo "info: creating shortcut..." wscript.echo "info: target = " & target wscript.echo "info: caption = " & caption wscript.echo "info: working path = " & wpath wscript.echo "info: shortcut path = " & where Set objShortcut = objShell.CreateShortcut(where & "\" & caption & ".lnk") objShortcut.TargetPath = target objShortcut.WorkingDirectory = wpath objShortcut.IconLocation = icon objShortcut.WindowStyle = wintype objShortcut.Description = tip objShortcut.Save If err.Number = 0 Then wscript.echo "info: shortcut created successfully" Else wscript.echo "error: failed to create shortcut" End If Else wscript.echo "error: shortcut location path was not specified" End If End Sub MakeShortcut "CMTrace", "C:\Users\Public\Documents\CMTrace.exe", _ "C:\Users\Public\Documents", _ "C:\Users\Public\Documents\CMTrace.exe", _ vbNormal, "CMTrace", "C:\Users\Public\Desktop"
Create the Package
Basically, you select the three (3) files and specify some options and create a new .exe at the end. That .exe is actually a self-extracting archive file which will contain the script files and the CMTrace.exe.
- Launch “iexpress.exe” any way you prefer
Select the first option…
Provide a Name…
Select the files to deliver…
Select “install.bat” in the drop-down list, but modify the statement to include “cmd /c” in front (or the execution later will fail)…
Specify the folder path and filename to save the new .exe. I named this one “InstallCMTrace.exe”…
You can save the .sed file if you want, which can be helpful for editing / modifying…
Click Next to create the package. You will see a CMD console appear and it will invoke makecab.exe and then close…
- You should now have four (4) files in the folder, unless you selected a different output location. If you saved a .sed file, that will also show up.
Recommendation: TEST this package locally, before proceeding! Run it using the local SYSTEM account (i.e. open a CMD console using psexec /s, etc. and invoke the .exe)
- Log into the Intune Tenant Administrator console
- Select Apps, then click on Apps and click “Add App”. You may be prompted to login again within the popup window.
- Select “Software Installer” and “Windows Installer (*.exe, *.msi)” and click Browse. Select the .exe you created and click Open. (Note: since this is a bundled file, you don’t need to check the box for additional files). Click Next
- Specify the Publisher, Name, and enter a Description. Select a Category, if desired. If you have a PNG or JPG to use for a portal image (icon), click Browse. Otherwise, click Next.
- For this example, leave the Architecture and Operating System Requirements settings alone, and click Next.
- Click “Add Rule” and select “File exists” from the drop-down list, and click the Add button just below it. Specify the path as shown below (just for the example). Click Next.
- Select “No” on Command Line Arguments, and click Next.
- Select “Yes” on Return Code options. I chose “No” just for the heck of it.
Click Close, when finished.
Tip: The final package should be around 294.33 KB in size.
- If you didn’t already create (or designated) a target Group, select Groups and create a new Group.
- Select the App you just created, and click “Manage Deployment”. Select the Group to target, and finish up.
When the app has been deployed to a computer, you should see a new desktop shortcut named “CMTrace” with the icon of the app .exe itself (a computer tower, with a notebook beside it). In addition, you should find the CMTrace.exe itself under C:\Users\Public\Documents, and a trace log file under the system %temp% folder (e.g. \Windows\Temp) or the user’s %temp% folder.
This concept is obviously very limited in capability. However, it could be adapted for use in performing hybrid App deployments with Intune to Windows desktop computers, whereby the installation content is hosted from an on-premises host (server, share). This would only be an option to consider if you do NOT have ConfigMgr in place, as this is a band-aid idea.
Some examples where this might be helpful (again: if you don’t have System Center ConfigMgr) could include such bloated installations as Adobe Creative Suite, Autodesk Infrastructure and Building Design Services, and Esri ArcGIS products. Then again, if your ExpressRoute setup has bodaciously-gnarly amounts of bandwidth and no limits, you can ignore all of this. But you still would need consider your storage limits (20 GB by default, but you can buy more), and slower download speeds than pulling content from a server within your environment.
Let me know what you think? Is this brilliant? Or is this stupid as hell? I’d love to hear your thoughts and experiences on this.