Solved

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

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
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…

615 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