Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING How to get report of Serial Number Monitor

  • Thread starter Thread starter Manuel
  • Start date Start date
  • Replies Replies 10
  • Views Views 16K

Manuel

Well-Known Member
Messages
301
Reaction score
8
Points
18
Hi to all

Does anyone know any way to get Serial Number monitor using SCCM CB?

any details would be great

Manuel
 
Hi Prajwal,

I hope so, but I did not see any SERIAL NUMBER option in the list. That's my concern because in the past we can get using MOF with powershell or something like that to get it.

Manuel
 
For computer monitors, you will need to look at third party software to inventory these details. At least if you wanted it to be reliable.
 
Monitor serial number will no be collected naively by SCCM. You will need to use a 3rd party tool to add this data and have it added to SCCM (via hardware inventory).

What exactly do you want to know about computer monitors? Just the serial number and I assume active state of the monitors, as I assume that you don't want to know about monitors no longer attached to a computer. Anything else?
 
Thank you very much Garth, what I want to know is the serial number of the Monitor, who is the owner, where it is located and active state of the monitors.
 
Who the owner is you will need to look at the computer details and see who is logon. For where, the same answer applies.

This is the type of stuff you can collected in SCCM with one of the tools. and yes this is one of my two monitors attached to my computer. Also keep in mind that I work for the company too.

MIR.png
 
I created the script below to use WMI and had some ppl to run around the computers to run the script. you can however, change the script below and deploy it from SCCM. The only caveat is that when the script is deployed to a laptop that is not hooked up to the screens then you wont get the information.
Code:
$desknumber= Read-Host -Prompt "Enter Desk number"
$extension= Read-Host -Prompt "Extension"
$computername = Get-WMIObject Win32_ComputerSystem | Select-Object -ExpandProperty name
$MonitorsCMD = ""

$MonitorsCMD = Get-WmiObject WmiMonitorID -Namespace root\wmi -ComputerName $computername

$Monitors = $MonitorsCMD
$LogFile = "\\share\$computername.txt"

"Manufacturer,Name,Serial,ComputerName,Extension" | Out-File $LogFile


For($i=1; $i -le ($Monitors.Count - 1); $i++)
{
    $nm = $Monitors[$i].UserFriendlyName -notmatch 0
    $Name = ""
    If ($nm -is [System.Array]) {
    For($j=0; $j -le ($nm.Count - 1); $j++)
    {
        $Name = $Name + [char]$nm[$j]
    }
    }
    $sr = $Monitors[$i].SerialNumberID -notmatch 0
    If ($sr -is [System.Array]) {
    $Serial = ""
        For($j=0; $j -le ($sr.Count - 1); $j++)
    {
        $Serial = $Serial + [char]$sr[$j]
    }
    }
    
    "$Manufacturer,$Name,$Serial,$computername,$extension" | Out-File $LogFile -append
     #echo "$Name, $Serial"
}
 
Hi to all

Does anyone know any way to get Serial Number monitor using SCCM CB?

any details would be great

Manuel
Here is a script that works fine, input is a text file with all computers you need, hostname one per line save it in the same PowerShell script path. run using account that has administrator privileges on target computers.
save the script as ComputerInfo.ps1 and the text file as MachineList.txt
output is an amazing Excel file
Machine NameIP AddressMachine TypeSerial NumberLogged OnMonitor 1 BrandMonitor 1 ModelMonitor 1 Serial NumberMonitor 2 BrandMonitor 2 ModelMonitor 2 Serial NumberMonitor 3 BrandMonitor 3 ModelMonitor 3 Serial Number

Script:

$ErrorActionPreference = "SilentlyContinue"

# Get the current script path
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path

# Read the list of computers from a text file
$computers = Get-Content -Path "$scriptPath\MachineList.txt"

# Create a new Excel workbook
$excel = New-Object -ComObject Excel.Application
$workbook = $excel.Workbooks.Add()
$worksheet = $workbook.Worksheets.Item(1)

# Set column headers
$worksheet.Cells.Item(1, 1) = "Machine Name"
$worksheet.Cells.Item(1, 2) = "IP Address"
$worksheet.Cells.Item(1, 3) = "Machine Type"
$worksheet.Cells.Item(1, 4) = "Serial Number"
$worksheet.Cells.Item(1, 5) = "Logged On"
$worksheet.Cells.Item(1, 6) = "Monitor 1 Brand"
$worksheet.Cells.Item(1, 7) = "Monitor 1 Model"
$worksheet.Cells.Item(1, 8) = "Monitor 1 Serial Number"
$worksheet.Cells.Item(1, 9) = "Monitor 2 Brand"
$worksheet.Cells.Item(1, 10) = "Monitor 2 Model"
$worksheet.Cells.Item(1, 11) = "Monitor 2 Serial Number"
$worksheet.Cells.Item(1, 12) = "Monitor 3 Brand"
$worksheet.Cells.Item(1, 13) = "Monitor 3 Model"
$worksheet.Cells.Item(1, 14) = "Monitor 3 Serial Number"

$row = 2

foreach ($computer in $computers) {
# Ping the computer to check if it's online
if (Test-Connection -ComputerName $computer -Count 1 -Quiet) {
$pingResults = $true

# Get IP address
$ipAddress = (Test-Connection -ComputerName $computer -Count 1).IPV4Address.IPAddressToString

# Get WMI objects for the computer
$computerSystem = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $computer
$bios = Get-WmiObject -Class Win32_BIOS -ComputerName $computer

# Get computer details
$machineName = $computerSystem.Name
$machineType = $computerSystem.Model
$serialNumber = $bios.SerialNumber
$loggedInUser = $computerSystem.UserName

# Write computer details to Excel
$worksheet.Cells.Item($row, 1) = $machineName
$worksheet.Cells.Item($row, 2) = $ipAddress
$worksheet.Cells.Item($row, 3) = $machineType
$worksheet.Cells.Item($row, 4) = $serialNumber
$worksheet.Cells.Item($row, 5) = $loggedInUser

# Get monitor information using WMI
$monitors = Get-WmiObject -Namespace root\wmi -Query "SELECT * FROM WmiMonitorID" -ComputerName $computer

$monitorCount = $monitors.Count
for ($i = 0; $i -lt $monitorCount; $i++) {
$monitor = $monitors[$i]
$brand = ([System.Text.Encoding]::ASCII.GetString($monitor.ManufacturerName)).TrimEnd()
$model = ([System.Text.Encoding]::ASCII.GetString($monitor.UserFriendlyName)).TrimEnd()
$serial = ([System.Text.Encoding]::ASCII.GetString($monitor.SerialNumberID)).TrimEnd()

# Write monitor details to Excel
$worksheet.Cells.Item($row, 6 + ($i * 3)) = $brand
$worksheet.Cells.Item($row, 7 + ($i * 3)) = $model
$worksheet.Cells.Item($row, 8 + ($i * 3)) = $serial
}
}
else {
$pingResults = $false
}

if (-not $pingResults) {
$worksheet.Cells.Item($row, 1) = $computer
$worksheet.Cells.Item($row, 2) = "Offline"
}

$row++
}

# Generate the timestamp for the file name
$timestamp = Get-Date -Format "MM-dd-yyyy-HH-mm"

# Save the Excel workbook with the timestamp in the file name
$excelFilePath = "$scriptPath\ComputerInventory_$timestamp.xlsx"
$workbook.SaveAs($excelFilePath)

# Close Excel
$workbook.Close()
$excel.Quit()

# Output the path of the saved Excel file
$excelFilePath
 

Forum statistics

Threads
7,043
Messages
27,534
Members
17,726
Latest member
jwabor

Trending content

Back
Top