Scripting Question

Collecting monitor information and attaching to an asset?

03/29/2018 1576 views
I found a slick little powershell script that will return the make, model, and serial number of monitors attached to a computer.

I would love to be able to run this script and return the results as additional assets and information in asset management.

The script looks like this:

function Decode {
    If ($args[0] -is [System.Array]) {
    Else {
        "Not Found"

echo "Name, Serial"

ForEach ($Monitor in Get-WmiObject WmiMonitorID -Namespace root\wmi) {  
    $Name = Decode $Monitor.UserFriendlyName -notmatch 0
    $Serial = Decode $Monitor.SerialNumberID -notmatch 0
    $Manufacturer = Decode $Monitor.ManufacturerName -notmatch 0
    $User = $Monitor.PSComputerName 
    echo "$User, $Manufacturer, $Name, $Serial"

... and the output looks like this:

COMPUTERNAME, VSC             , VP2765 SERIES, SHK16286****    
COMPUTERNAME, VSC             , VP2765 SERIES, SHK16286****

So, this is exactly the information that I want to bind to my asset management...  the manufacturer, model, and serial number of monitors attached to the assets.  Perhaps under "Related Assets" would be ideal..

I got this far... but I'm completely lost when it comes to actually making KACE gather this information on our machines and attach it to the correct assets.

Can someone point me in the right direction?  

Thank you so much in advance!

Answer Summary:
1 Comment   [ + ] Show comment


  • Well, that's better than not having it at all. It put it under software --> Custom Inventory Fields (oh, and I had to do a minor edit to the powershell script because it was putting NULs in the text file, which was really hosing things up)... it would be nice if I could have put it under Inventory Information --> Hardware in some way, but I didn't find a way to do that.
    But as I said, at least I've got the information there in KACE, which is certainly better than walking around to every computer and writing down serial numbers. :D

Answer Chosen by the Author

Redirect the output in a text file (ie: c:\windows\temp\monitor.log, or  C:\ProgramData\Quest\KACE\monitor.txt, or wherever you want) then creata a Custom Inventory Rule that reads and import into Kace the text content.

Like this:

Answered 03/30/2018 by: c.castellari
Orange Senior Belt

All Answers


How do you place this information into a txt file on the c drive (c:\kbox)

so in kbox folder you see monitor.txt

Answered 05/24/2018 by: Kdebiasse
8th Degree Black Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ