As .NET Frameworks versions expire, you may need to identify which applications need to be recompiled/retargeted with a new version of .NET Framework. One method I found was to use Mono.Cecil to gather .NET assembly information such as the runtime required as well as the .NET Framework version used. Note the Framework version is only available for assemblies using the 4.0 runtime and up.
For example, you can then do the following to capture information for multiple assemblies in IIS sites running .NET code:
(ls \\contoso001\c$\inetpub\wwwroot\*\*\bin\*.dll).FullName | .\Get-FrameworkVersion.ps1 | Export-Csv AssembliesVersions.csv -NoTypeInformation -Append
You can find the script here:
The new script and the required assembly are part of the new GEM Automation 126.96.36.199 release.