Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Powershell Script to get what.NET Versions are installed on several remote servers

Posted on 2014-10-08
5
Medium Priority
?
1,961 Views
Last Modified: 2017-02-16
Powershell Script to get what .NET Versions are installed on several remote servers and exports the results to a .csv file
0
Comment
Question by:mjm21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 40368711
There you go.

$computers = Get-Content "C:\remotecomputers.txt"
foreach ($computer in $computers) {
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version -EA 0 |
Where { $_.PSChildName -match '^(?!S)\p{L}'} |
Select PSChildName, Version | Select @{Name='Computer Name';Expression={$computer}},PSChildName,Version | Export-CSV "C:\NetVersions.csv" -Append -nti
}

Open in new window

0
 

Author Comment

by:mjm21
ID: 40368868
Cool!  But getting this error:

Export-Csv : A parameter cannot be found that matches parameter name 'Append'.
At line:6 char:146
+ Select PSChildName, Version | Select @{Name='Computer Name';Expression={$computer}},PSChildName,Version | E
xport-CSV "C:\NetVersions.csv" -Append <<<<  -nti
    + CategoryInfo          : InvalidArgument: (:) [Export-Csv], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.ExportCsvCommand
0
 
LVL 16

Accepted Solution

by:
Joshua Grantom earned 2000 total points
ID: 40369027
try this, added a variable to store all of the results to and then output to CSV when the foreach statement is finished. Even renamed the Column to say .NET Name

$results = @()
$computers = Get-Content "C:\remotecomputers.txt"
foreach ($computer in $computers) {
$results += Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | Get-ItemProperty -name Version -EA 0 | Where { $_.PSChildName -match '^(?!S)\p{L}'} | Select @{Name='Computer Name';Expression={$computer}},@{expression={$_.PSChildName};label='.NET Name'},Version
}
$results | Export-CSV "C:\NetVersions.csv" -nti

Open in new window

0
 
LVL 16

Expert Comment

by:Joshua Grantom
ID: 42012491
Wow that was 2 years ago, any way I can modify that Qlemo?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many times while working on a computer regardless of any Operating System, lag and crashes seem to creep in, hindering your working speed. Sometimes, it can also cause your work to be lost unexpectedly and as a result, you are unable to meet your de…
This article covers how to install the Microsoft Windows Operating System (OS). What is covered in this article:  > Different Versions and Editions of the Windows OS  > Upgrading versus Fresh Installation of the OS           - Steps to take pr…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question