I am trying to get inventory of all the monitor connected to the Windows OS, more specifically the Serial Number. I found this great powershell script online but the issue is that I need to remotely query thousands of machines so see if it can feed a txt file with a list of computer names. I modified to add the Get-Content and Export-csv. The issue is it just stops at the first computer in the txt file and does not proceed. Any assistance will be greatly appreciated.
Ensure you have the list of computer names each one per line without any delimiter, and also add the PSComputerName to your output to identify the record from, other than that I don’t see any issues here, and it is working fine with me.
I just ran with your updated code and its the same issue. The TEST.csv is not displaying the ComputerName… its showing System.Object for each entry. Everything else looks good, as its showing all the connected monitors for the computer and their SerialNumber. Somehow, it can’t loop back to display the Computer name in the txt to show on the TEST.csv file. This works fine for you?
Sorry, one important info that I left out is…this works fine when there is only 1 computer name in the txt file. If there are more than 1 computer name, the TEST.csv will not display the ComputerName properly. It will show System.Object
This script is working, however it is not returning the complete serial number of the monitor. The script returned “N01VP24P31XS” and the complete serial number of the monitor is “CN0N01VP6418024P31XS”. What would be causing part of the serial number to not display?
So basically, given the serial number CN-0N01VP-64180-24P-31XS
CN identifies the country where the monitor was manufactured
N01VP is a Dell part number, padded with a leading zero (this will be consistent for all monitors of the same type)
64180 identifies the factory where the monitor was manufactured
24P is a date of manufacture code (Y/M/D)
31XS is a manufacturer code (this is the actual identifier that should be unique to each monitor)
Of this information, it seems that Dell does not program the country code, leading zero of the part number, or factory code into the identification information on the monitor itself. It’s not an issue with the script, it’s a limitation of the information that Dell programs in when the monitor is manufactured.