Kaseya Community

Report to get version of Dot Net

This question is not answered

I'm trying to write a report to find out what version of Dot Net is installed on a Windows workstation.  I know the version number is listed in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Client\Version, but I don't know how to check it and then generate a report based on it.

The second part is, if the version is sufficiently old, is there a way to push install of v.4.7.1 or 4.7.2?

Thanks,

- Jonathan

All Replies
  • Hi Jonathan, I think it's a bit more complex than just that registry key - see here: docs.microsoft.com/.../how-to-determine-which-versions-are-installed

    In terms of getting them up to date with .NET 4.7.2 - these are now available through Microsoft Update, meaning they should be displayed in Kaseya's patch management (I'm assuming you are using this). Rather than worry too much about which machines are on which version why not approve the update there and then any that need it will get it on their next patching cycle. You can then report on which still show it as 'needed but missing' to determine any that might need manual remediation, etc.

  • Apart from putting complete .NET versions on your VSA and running installs that way (which will tax your VSA big time and I wouldn't think of doing), Patch Management surely is the way to go. At this time the results we get are OK. Checking results and having procedures to reset the Windows part of Patch Management is something we need to do om a regular basis.

  • , we have an audit script on ClubMSP (membership required) called "dotNET Audit", that uses a utility from Asoft to figure out what is installed...      Since .NET tends to install on top of itself, you may have multiple layers of compatibility.  This utility just dumps it out, and we grab that, write it to the procedure log with a tag so you can run a report.

    This is what the output looks like:

    ASoft ASoft .NET Version Detector 18 R1 Report Download latest version at http://www.asoft.be ==== INFO ==== Created :2018/08/31 - 12:29:46 Computer:ND-CPU-CHRIS8 ==== FOLDERS ==== <32Bit> 2.0.50727.8793 ->C:\Windows\Microsoft.NET\Framework\v2.0.50727 4.7.3133.0 ->C:\Windows\Microsoft.NET\Framework\v4.0.30319 <64Bit> 2.0.50727.8793 ->C:\Windows\Microsoft.NET\Framework64\v2.0.50727 4.7.3133.0 ->C:\Windows\Microsoft.NET\Framework64\v4.0.30319 ==== Installed .NET Frameworks ==== .NET FW 2.0 SP 2 (CLR 2.0) .NET FW 3.0 SP 2 (CLR 2.0) .NET FW 3.5 SP 1 (CLR 2.0) .NET FW 4.6.2 (CLR 4.0) .NET FW 4.7 (CLR 4.0) .NET FW 4.7.1 (CLR 4.0) ==== END REPORT ==== $dotNET$ $Audit$

    We have a "Install dotNET 4.6" script, but I do not see one for 4.7 (not sure why, probably because as is saying, it is able to be installed via patching, and no one has asked us!).

  • JMargulies,

    A good answer is here:

    stackoverflow.com/.../3495491

    As x link you can get all frameworks installed on the target machine with below powershell script:

    $Lookup = @{

       378389 = [version]'4.5'

       378675 = [version]'4.5.1'

       378758 = [version]'4.5.1'

       379893 = [version]'4.5.2'

       393295 = [version]'4.6'

       393297 = [version]'4.6'

       394254 = [version]'4.6.1'

       394271 = [version]'4.6.1'

       394802 = [version]'4.6.2'

       394806 = [version]'4.6.2'

       460798 = [version]'4.7'

       460805 = [version]'4.7'

       461308 = [version]'4.7.1'

       461310 = [version]'4.7.1'

       461808 = [version]'4.7.2'

       461814 = [version]'4.7.2'

    }

    Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse |

       Get-ItemProperty -name Version, Release -EA 0 |

    Where-Object { $_.PSChildName -match '^(?!S)\p{L}'} |

       Select-Object @{name = ".NET Framework"; expression = {$_.PSChildName}},

    @{name = "Product"; expression = {$Lookup[$_.Release]}},

    Version, Release

    OR get just the latest installed by CHANGING

    Where-Object { $_.PSChildName -match '^(?!S)\p{L}'} |

    TO

    Where-Object { $_.PSChildName -eq "Full"} |

    and eventually get the script ready to be used by a procedure and read into a variable easier by doing this:

    $Lookup = @{

       378389 = [version]'4.5'

       378675 = [version]'4.5.1'

       378758 = [version]'4.5.1'

       379893 = [version]'4.5.2'

       393295 = [version]'4.6'

       393297 = [version]'4.6'

       394254 = [version]'4.6.1'

       394271 = [version]'4.6.1'

       394802 = [version]'4.6.2'

       394806 = [version]'4.6.2'

       460798 = [version]'4.7'

       460805 = [version]'4.7'

       461308 = [version]'4.7.1'

       461310 = [version]'4.7.1'

       461808 = [version]'4.7.2'

       461814 = [version]'4.7.2'

    }

    Clear-Host

    Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse |

       Get-ItemProperty -name Version, Release -EA 0 |

    Where-Object { $_.PSChildName -eq "Full"} |

      Select-Object -ExpandProperty Version | Out-String

    That strips headers and leaves you only with the framework number for your #global:psresult# output.

    Best Regards

    Alex

  • Thank you, all, for the various suggestions. I actually found an easier solution (admittedly with help from tech support).  I created a report against Add/Remove Programs, then filtered out older versions (below 4.0).  This works well, and then I have a simple agent procedure to install the latest 4.7.2 from a local network share (where I downloaded the full installer package).