0

I'm not a sysadmin myself but am asking this question on behalf of a client of mine, a "mom and pop" company without about 50 computers on a Windows Server network. They want a way for their systems administrator to determine what versions of the NET Framework are installed on the users' PCs, without her having to walk around to each desktop and query the registry of each machine. Does a utility exist that she can run from her own PC? Or is there perhaps an ActiveDirectory policy setting that would cause each desktop PC on the domain to report that version info back to a central repository, which she could examine?

Tim
  • 175
  • 1
  • 2
  • 10
  • This should help: https://stackoverflow.com/questions/3487265/powershell-script-to-return-versions-of-net-framework-on-a-machine – Massimo Jun 23 '20 at 19:52

1 Answers1

3

You can use PowerShell to determine which .NET version is installed on a remote computer from registry:

Invoke-Command -Computer "COMPUTER_NAME" -ScriptBlock { gci ‘HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP’ -recurse | gp -name Version -EA 0 | where { $_.PSChildName -match ‘^(?!S)\p{L}’} }

Your PC needs to be in the same domain, be reachable over local network from yours to be able to use that command and client must have enabled PSRemoting - it can be done by running Enable-PSRemoting -Force. Also your domain account needs administrative privileges on remote computers, but if this is not possible due to the company's security policy, check this out: https://4sysops.com/archives/powershell-remoting-without-administrator-rights/

Also everyone can run that script locally in Powershell and save results for example to C:\results.txt like below:

gci ‘HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP’ -recurse | gp -name Version -EA 0 | where { $_.PSChildName -match ‘^(?!S)\p{L}’} | Out-File C:\results.txt
maar
  • 487
  • 6
  • 20
  • This answer is **WRONG**. The command queries the list of installed programs (the one you can see in Control Panel), but the .NET Framework stopped appearing there several Windows versions ago. – Massimo Jun 23 '20 at 19:47
  • @Massimo: That's odd. When I tried it on my Windows 10 Pro PC, it displayed a complete listing, showing every version installed on the machine, running the gamut from 4.5.50932 to 4.8.03671. But then, "Windows version" is a fuzzy thing anymore. – Tim Jun 23 '20 at 20:02
  • @Tim this is indeed strange, because .NET Framework doesn't appear in that list; you can check manually by opening the "Programs and features" list in Control Panel. – Massimo Jun 23 '20 at 20:12
  • @Tim unless you have the SDK installed; *that* will appear in Programs and features. But the standard .NET Framework doesn't appear there. – Massimo Jun 23 '20 at 20:14
  • @Massimo, ah, you're right. The listing reads `Microsoft .NET Framework 4.7.2 Targeting Pack ..... 4.7.03062`. – Tim Jun 23 '20 at 20:17
  • So is it better to check it from registry? Using this command for example: `gci ‘HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP’ -recurse | gp -name Version -EA 0 | where { $_.PSChildName -match ‘^(?!S)\p{L}’}` – maar Jun 23 '20 at 20:18
  • @Maar yes, as per Microsoft documentation: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed – Massimo Jun 23 '20 at 20:25
  • 1
    Okay, I corrected my answer. – maar Jun 23 '20 at 20:37