Script or report for TPM version installed on all computers

I need to run a report on all computers in my domain.
Get-WMIObject –class Win32_Tpm –Namespace root\cimv2\Security\MicrosoftTpm
I'm specifically looking for ManufacturerVersionFull20 and SpecVersion and computername

I've been able to run this command in Powershell on my current machine.

I do not know powershell or scripting,  I ws hoping someone could show me the script I need to run and how to export the report to excel or even a text file.
Who is Participating?
footechConnect With a Mentor Commented:
A lot of the approach would be determined by your environment.  Best scenario (in my opinion) is if you have PS Remoting enabled on every machine.
And then there's the question of where the computer list comes from.  Is there a text file of all names at the ready?  AD?  What sort of filtering would be needed to form a good list?

Here's an example showing use of a text file as source, and PS Remoting as protocol, exporting to a .CSV.
$computers = Get-Content computers.txt
$scriptblock = {
    Get-WMIObject –class Win32_Tpm –Namespace root\cimv2\Security\MicrosoftTpm | Select ManufacturerVersionFull20,SpecVersion
Invoke-Command -computername $computers -scriptblock $scriptblock | Select PSComputerName,ManufacturerVersionFull20,SpecVersion |
 Export-Csv results.csv -notype

Open in new window

EkuskowskiAuthor Commented:
Very helpful,  I was having some security problems running the script.  I decided to try from Powershell with just one line of code and this is what worked for me

Get-WMIObject -computername Computername1,computername2,computername3 –class Win32_Tpm –Namespace root\cimv2\Security\MicrosoftTpm | Select PSComputerName,ManufacturerVersion,ManufacturerVersionFull20,SpecVersion | Export-Csv results.csv -notype and this seemed to work .
All Courses

From novice to tech pro — start learning today.