Getting Company Portal apps locally using PowerShell (no auth!)

As you may know, I work at Intility in the application packaging space. 

I've been doing that since about 2015, and during that time I and my collegaues have developed standards and systems to help us package apps better and faster. The so far last and unifying system is AppPackBot, which you can read more about at Intility Engineering.

I won't (and quite frankly can't) go into all the nuts and bolts beyond what that blog post says, but I wanted to share something.

You see, there are mainly two "app stores" in a corporate Windows environment. Good old Software Center, and the new Company Portal. Software Center can be programmatically interacted with using the CCM_Application WMI Class. But Company Portal, not so much. 

I burst out laughing when I read this attempt to install an app from Company Portal using PowerShell.
Tldr: Using the companyportal: protocol to open Company Portal with a given app guid, and then sending a ctrl+i keystroke that equals clicking install. And this is MVP-worthy content. I mean, it probably works, but wow.

So what do I have to show you guys? I've been studying the IntuneManagementExtension logs for more hours than I'd like to admit, learning what gets logged when and why. To some degree at least, at times the behavior seems a bit random. 
There is one huge log entry that is really interesting and gets written from time to time. It starts with "Get policies" and pretty much lists the Win32Apps Company Portal has been dealing with lately. 

But that line is huge and consists of multiple nested json values, base64 encodings and enums I struggle to find documentation for. So I wrote a function that finds and reads this line and returns something that is actually useful.

Get-IntuneWin32AppsFromLog

That function can run on any Intune managed computer without any administrative privileges locally or in Intune, and get you so much more technical information than Company Portal ever will.

(Using our Firefox app as example)

I'm not sure what to do with this in practice, except aid debugging application packaging and deployment on the client side. I've never seen someone else present the log data in a practical manner, I hope you find this useful. Have a great day! :)




Bonus fun fact: There is a funny typo in one of the properties:
AppApplicabilityStateDueToAssginmentFilters
Assgin, haha. 🍸

Comments

Popular posts from this blog

Hidden settings in the Raspberry Pi Imager

Getting the Miyoo Mini Plus battery into Home Assistant