PowerShell
Edit|Remove
<#    
.Name 
    Get-RemoteNetFrameWork 
.SYNOPSIS    
   Script to query single or multiple systems for their .Net Framework versions 
 
.DESCRIPTION  
   This script will query a remote system or multiple systems registry for the current .Net Framework installed.  
 
.SYNTAX 
    Get-RemoteNetFramework [[-SingleSystem] [-MultipleSystems]] 
     
.PARAMETERS 
   -SingleSystem 
         
    
   -MultipleSystems   
 
.LINK    
   https://gallery.technet.microsoft.com/Get-Net-Framework-of-f2c91f50   
 
.EXAMPLE    
   Get-RemoteNetFramework -SingleSystem 
        Will prompt you to define a single system name. 
        Will prompt you for credentials to connect to the box 
        Will attempt to connect to the box 
        Will provide a gridview of the results 
    
   Get-RemoteNetFramework -MultipleSystems 
        Will open an explorer window for you to select a .txt file. 
        Will prompt you for credentials to connect to the box 
        Will attempt to connect to the box 
        Will provide a gridview of the results 
 
.Remark 
   Author: by David Dubuque 
   Date Authored: 3/9/2018 
   This script is offered as is.  You're welcome to use and modify, but please ensure to give credit to original author.  
#> 
 
 
Function Get-RemoteNetFrameWork { 
 
    Param([Switch]$SingleSystem ,  
          [Switch]$MultipleSystems) 
 
    $ErrorActionPreference'silentlycontinue'  
    $FinalOutput = @() 
    Write-Host "Prompting for credentials to connect to systems with" 
    $Creds = Get-Credential 
    if($SingleSystem) 
        { 
            $SystemNames = Read-Host "Please provide a single system name" 
            if(!$SystemNames) 
                { 
                    Write-Host "Error: You did not provide a system name, please re-run and enter a value" -ForegroundColor Red 
                } 
            else 
                { 
                    Write-Host $SystemNames 
                } 
                 
 
        } 
     
    elseif($MultipleSystems) 
        { 
            Write-Host "Please select the input file" -ForegroundColor Green 
            Write-Host "" 
            $fd = New-Object system.windows.forms.openfiledialog 
            $fd.InitialDirectory = ([Environment]::GetFolderPath("Desktop")) 
            $fd.MultiSelect = $false 
            $fd.showdialog() 
            $fd.filenames 
            $SystemNames = Get-Content $fd.filenames 
            if(!$SystemNames) 
                { 
                    Write-Host "Error: Could not gather a list of systems, please re-run and make sure you provide the correct path" -ForegroundColor Red 
                } 
 
        } 
    else 
        { 
            Write-Host "Error: You must define -SingleSystem or -MultipleSystems as a switch" -ForegroundColor Red 
        } 
 
 
        foreach($System in $SystemNames) 
            { 
 
                $TestConn = @() 
                $TestConn = Test-Connection -Count 1 $System -ErrorAction SilentlyContinue 
 
                if($TestConn) 
                    { 
 
                        $Result = Invoke-Command -Computername $System -Credential $Creds { 
                        $NetRegKey = Get-Childitem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' 
                        $Release = $NetRegKey.GetValue("Release") 
                        Switch ($Release) { 
                           378389 {$NetFrameworkVersion = "4.5"} 
                           378675 {$NetFrameworkVersion = "4.5.1"} 
                           378758 {$NetFrameworkVersion = "4.5.1"} 
                           379893 {$NetFrameworkVersion = "4.5.2"} 
                           393295 {$NetFrameworkVersion = "4.6"} 
                           393297 {$NetFrameworkVersion = "4.6"} 
                           394254 {$NetFrameworkVersion = "4.6.1"} 
                           394271 {$NetFrameworkVersion = "4.6.1"} 
                           394802 {$NetFrameworkVersion = "4.6.2"} 
                           394806 {$NetFrameworkVersion = "4.6.2"} 
                           461310 {$NetFrameworkVersion = "4.7.1"} 
                           Default {$NetFrameworkVersion = "Net Framework 4.5 or later is not installed."} 
                            } 
                        $NetFrameworkVersion 
                        } 
                    } 
                
                Else 
                    { 
                        $Result = 'System is not reachable' 
                    } 
 
                    $OutputInfo = [pscustomobject]@{ 
                                                        SystemName = "$System" 
                                                        Result = $Result 
                                                   } 
 
                    $FinalOutput +$OutputInfo 
            } 
        $FinalOutput|Out-GridView 
     
} 
 

Get .Net Framework of Remote System

 This PowerShell function is written with the intent of querying single or multiple systems quickly to determine the .Net Framework installed on your system(s)

The function is called

 

Get-RemoteDotNetFramework

 

There are two switches, see below for more information on each, and what each will do

 

-SingleSystem

 Command to run:  Get-RemoteDotNetFramework

This will prompt you to define a system name, then prompt for credentials to connect to the system, then attempt to reach the system, will provide a gridview output of the system and the .Net version


 

-MultipleSystems

Command to run Get-RemoteDotNetFramework

This will open an explorer window (defaults to current users desktop), then prompt for credentials, will attempt to connect to the box, will provide an gridview of each system

 

If it's unable to connect, the results field will denote it's inability to connect.

 

Note:  This script is written to input a .txt file with a list of systems, do not use a CSV, or you will need to change the logic to account for the CSV.  This script is free to be used/modified, I just ask that you give credit to the original author.