Solved

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

Posted on 2014-10-08
5
1,898 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
  • 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
File Types Dropdown box 3 37
Time Syncronization from Windows 7 Machine to Server 7 123
Account lockout on new XenApp 7.6 farm - Kerberos?? 8 192
robocopy vs xcopy vs copy 8 149
My purpose is to describe the basic concepts of virtual memory as implemented in a modern Windows-based operating system. I will also describe the problems inherent in older systems and how virtual memory solves them. The dark ages - before virtu…
In a hurry?.. scroll down to "HERE's HOW TO DO IT" Section. Greetings All, I was going to post this as question/solution, but its seems more appropriate as an article considering its length.  I felt it important to illucidate all the details c…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
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…

679 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