Use PowerShell to check for installed .NET Framework Version

As part of an application upgrade we had to check all of our Domain Controllers for the .NET Framework version installed as we had a minimum requirement. Rather than logging into each server a Powershell script can be used to remote do the check and record the output for further analysis. The script plus some more details can be found here. The script will take a list of computers to run against but with PowerShell we can pipe in the result of a Active Directory look-up serving as the input. To find out who to tailor this part please refer here. In our case all DC are following a naming convention, i.e. the DC server name will look like ‘XXX-ADC-XX’. The common pattern here is ‘ADC’ which we use as a filter for the AD query. Here is the command line:

Get-DotNet-Version.ps1 -ComputerName $(Get-ADComputer -Filter '*' | Where { $_.Name -imatch 'ADC' } | Select -ExpandProperty Name)

PowerShell Get .Net Version

After the script has finish the results will be written into three files in the current directory. The DotNet-Versions-2015-02-11.csv CSV file contain the Server name and all of the installed .NET version and can be opened with Excel for further analysis.

PowerShell Get .NET CSV File

 

Pages: 1 | 2 | Single Page

Leave a Reply

Your email address will not be published. Required fields are marked *