[PowerShell] Retrieve temperature information for Nvidia display cards

Some Nvidia display cards has support for WMI such that you could retrieve the temperature information.

For more information, please check out NVIDIA Windows Management Instrumentation SDK

Below is the code for local computer, you can always change the $ComputerName variable to point to a remote computer. I had it probe for all instances of the ThermalProbe, you can comment that out and un-comment the last 3 lines for temperature only. The majority part of the code comes from Nvidia’s SDK examples, which you could download from the link above.

Please note, as I only have NVS cards, I had filled up $supportedModels with the NVS model I have.

$supportedModels= "NVIDIA NVS 290","NVIDIA NVS 295","NVIDIA NVS 300","NVIDIA NVS 310","NVIDIA NVS 315","NVIDIA NVS 420","NVIDIA NVS 450","NVIDIA NVS 510","NVIDIA Quadro NVS 450"

$video_card_name=(gwmi win32_videocontroller -ComputerName $ComputerName)|select-object -expand name
write-host $video_card_name

If($supportedModels|?{$video_card_name -match $_})

#Write-Host "True"
gwmi -ComputerName $ComputerName -Namespace root\CIMV2\NV gpu|select-object name,percent*

$namespace = "root\CIMV2\NV"
$classname = "ThermalProbe"
# For local system (e.g. "LocalHost", ".") '-computername $computer' could be omitted
# retrieve all instances of the ThermalProbe class and store them:
$probes =Get-WmiObject -class $classname -computername $ComputerName -namespace $namespace
# print all ThermalProbe instances
# iterate through all Probe instances
foreach( $probe in $probes )
#"Call the info() method and print all the data"
$res = $probe.InvokeMethod("info",$Null)
#"Query just the temperature"
#$temp = $probe.temperature

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.