Updating any old versions of teams, issue with relevancy clause

I am currently trying to update teams installations that are prior to the version “26903”

This is the relevance clause we are using, but it doesn’t seem to be working. Any insight?

(exists true whose (if true then (exists (if (exists value "Path" of it) then (( parenthesized part of match (regex "MSTeams_([0-9.]+)_") of (value "Path" of it as string))) else "None") of keys whose (value "Path" of it as string contains "MSTeams" ) of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications\" of (x64 registry; x32 registry) whose (it as string as lowercase < "26903" as lowercase)) else false))

Could you possibly paste in the registry path, key, and value that you are trying to match? I don't have a sample handy.

Interesting. I didn't know that the version of Appx is being saved on the registry.

I've used the winrt inspector and reading the XML content to get the version.

I'll try it later and check your suggestion

TBH I’m not sure if Teams appears in the same way as other apps do. I have Teams from the store and nothings exists in the Appx\AppxAllUserStore section of the registry.

Q: keys whose (name of it as lowercase contains "teams") of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications\" of (x64 registry; x32 registry) 
T: 1019.279 ms
I: plural registry key

I can see it via regapp, winrt and parsing the AppxManifest.xml though.

Q: version of regapps "ms-teams.exe"
A: 26093.415.4620.1935
T: 1017.578 ms
I: singular version

Q: pathname of regapps "ms-teams.exe"
A: C:\Program Files\WindowsApps\MSTeams_26093.415.4620.1935_x64__8wekyb3d8bbwe\ms-teams.exe
T: 1016.435 ms
I: singular string


Q: unique values of (((select "/Package/Properties/DisplayName" of it as text) & " " & (node value of attribute "Version" of select "/Package/Identity" of it)) of xml documents of files "AppxManifest.xml" of folders whose (name of it contains "Teams") of folder "C:\Program Files\WindowsApps")
A: Microsoft Teams 26093.415.4620.1935
T: 1015.188 ms
I: plural string with multiplicity

Q: installed path of winrt packages whose (it as string as lowercase contains "teams")
A: C:\Program Files\WindowsApps\MSTeams_26093.415.4620.1935_x64__8wekyb3d8bbwe
T: 911.557 ms
I: singular folder

Quite possible this is the behaviour for a user based installation vs a machine based installation, hence why HKLM has no indicators.

2 Likes

We’ve been installing teams via the bulk deployment article on Microsoft’s website (teamsbootstrapper + Teams MSIX)

I am awful at creating relevance clauses. Especially because registry key things I’m a little slow on.

After reading other responses to this article, I am wondering if checking for a specific registry key is even the correct way to go about finding out what version of Teams people are on. I’m fairly new to patch management and so it’s been a lot of tinkering.

Its often a case of trial and error with apps, especially with the varying installer technologies and user context.

I’d be tempted to build an interim property for some investigative due diligence to gain insights as to the most accurate way to detect the apps and its version as then you can re-use the most accurate method within the fixlet detection method.

Q: "Regapp:" & (exists version of regapps "ms-teams.exe") as string, "AppManifest:" & (exists unique values of (((select "/Package/Properties/DisplayName" of it as text) & " " & (node value of attribute "Version" of select "/Package/Identity" of it)) of xml documents of files "AppxManifest.xml" of folders whose (name of it contains "Teams") of folder "C:\Program Files\WindowsApps")) as string, "HKLM:" & (exists value "Path" of keys whose (name of it as lowercase contains "team") of keysHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications\" of (x64 registry; x32 registry)) as string 
A: Regapp:True, AppManifest:True, HKLM:False 
T: 92.621 ms 
I: singular ( string, string, string ) 

It does appear that Teams registers itself as a regapp (i.e. the vendor adds its path under the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" registry hive) and for me personally, that would be my first choice of detection method as its quick and easy and has minimal endpoint impact each time the fixlet get re-evaluated.

1 Like