Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # SysInfo - DesktopMonitor
- $SysInfoProps = [ordered]@{}
- $CIM_DesktopMonitor = @(Get-CimInstance -ClassName CIM_DesktopMonitor)
- foreach ($CDM_Item in $CIM_DesktopMonitor)
- {
- $Index = "{0:D2}" -f $CIM_DesktopMonitor.IndexOf($CDM_Item)
- $SysInfoProps.Add("Vid_Monitor_${Index}_Name", $CDM_Item.Name)
- $SysInfoProps.Add("Vid_Monitor_${Index}_Manufacturer", $CDM_Item.MonitorManufacturer)
- $SysInfoProps.Add("Vid_Monitor_${Index}_PPI_Logical_X", $CDM_Item.PixelsPerXLogicalInch)
- $SysInfoProps.Add("Vid_Monitor_${Index}_PPI_Logical_Y", $CDM_Item.PixelsPerYLogicalInch)
- $SysInfoProps.Add("Vid_Monitor_${Index}_ScreenRes_X", $CDM_Item.ScreenWidth)
- $SysInfoProps.Add("Vid_Monitor_${Index}_ScreenRes_Y", $CDM_Item.ScreenHeight)
- }
- $CIM_MonitorID = Get-CimInstance -Namespace root\wmi -ClassName wmiMonitorID
- foreach ($CMID_Item in $CIM_MonitorID)
- {
- $MfgID = -join $CMID_Item.ManufacturerName.ForEach({[char]$_})
- $ProductCodeID = -join $CMID_Item.ProductCodeID.ForEach({[char]$_})
- $SerialNumber = -join $CMID_Item.SerialNumberID.ForEach({[char]$_})
- $FriendlyName = -join $CMID_Item.UserFriendlyName.ForEach({[char]$_})
- $MfgDate = ((Get-Date -Year $CMID_Item.YearOfManufacture -Month 1 -Day 1).
- AddDays(7 * $CMID_Item.WeekOfManufacture)).
- ToString('yyyy-MM-dd')
- $Index = "{0:D2}" -f $CIM_MonitorID.IndexOf($CMID_Item)
- $SysInfoProps.Add("Vid_Monitor_${Index}_Active", $CMID_Item.Active)
- $SysInfoProps.Add("Vid_Monitor_${Index}_MfgID", $MfgID)
- $SysInfoProps.Add("Vid_Monitor_${Index}_ProductCodeID", $ProductCodeID)
- $SysInfoProps.Add("Vid_Monitor_${Index}_SerialNumber", $SerialNumber)
- $SysInfoProps.Add("Vid_Monitor_${Index}_FriendlyName", $FriendlyName)
- $SysInfoProps.Add("Vid_Monitor_${Index}_MfgYear", $CMID_Item.YearOfManufacture)
- $SysInfoProps.Add("Vid_Monitor_${Index}_MfgWeek", $CMID_Item.WeekOfManufacture)
- $SysInfoProps.Add("Vid_Monitor_${Index}_MfgDate", $MfgDate)
- }
- $SysInfoProps
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement