Extract BIOS dates to sort systems by age
We currently have close to 5,000 Windows PCs that vary from brand new to around 8 years old. They are a mixture to various brands, most being Dell, HP and Gateway. The majority came from a PC refurnisher so there is no inventory from invoice data.Our department has been asked to sort the machines by age so that the oldest machines can be replaced first. The K1000 lists BIOS age in the description on some machines, but not on most. Any suggestions on how to cull system ages using the K1000?
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
rmeyer
12 years ago
You can run this as a script on the PC's then do a custom inventory :)
strComputer = "."
dim ReleaseDate
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colBIOS = objWMIService.ExecQuery _
("Select * from Win32_BIOS")
For each objBIOS in colBIOS
' Wscript.Echo "Release Date: " & objBIOS.ReleaseDate
ReleaseDate = objBIOS.ReleaseDate
Next
FullDate = Left(ReleaseDate, 8)
RelYear = Left(FullDate, 4)
MonthDay = Right(FullDate, 4)
RelMonth = Left(MonthDay, 2)
RelDay = Right(FullDate, 2)
'To test the Year/Month/Date
'wscript.echo FullDate
'wscript.echo RelYear
'wscript.echo RelMonth
'wscript.echo RelDay
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&_
strComputer & "\root\default:StdRegProv")
'Write it into a registry key so you can make a custom inventory
Return = objReg.SetStringValue(HKEY_LOCAL_MACHINE,"SOFTWARE\KACE","BIOSReleaseDate",RelYear & "-" & RelMonth & "-" & RelDay )
Comments:
-
How exactly did you write the custom inventory for this script? - baileyb 12 years ago
Posted by:
jvincent
12 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.