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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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 .
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.