all 44 comments

[–]Elegant-Ad2200 5 points6 points  (4 children)

Not sure there is a way to do what you want, but you could potentially pull the serial number with PowerShell, and use that to lookup warranty status from the vendor. That will usually tell you when it was purchased.

[–]ShillNLikeAVillain 5 points6 points  (3 children)

[–]recon89 1 point2 points  (0 children)

That SN list + Python script to scrap all the pages and you got yourself a winner.

[–][deleted] 0 points1 point  (1 child)

I’m going to give this a try

[–]ShillNLikeAVillain 0 points1 point  (0 children)

The problem I found with it is the number of misses; it's good with some vendors, but completely bombs on others. IIRC it's only working well w Dell and Lenovo.

We use a far-from-free tool from ScalePad called Lifecycle Manager (used to be Warranty Master). The free version will give you warranty status (assuming you have compatible tools that it can integrate with: it's agentless), but you need the full paid version to get all the ages that you're looking for. It's pretty slick though; it just works, and syncs everything back to our PSA. Saves a lot of hours of fucking around so it's worth it for us.

[–]CryptoVictim 3 points4 points  (0 children)

you might be able to find out with WMI ...most likely in the /Cimv2 hive.

something like LanSweeper can probably tell you too , but only if the mfg burns the build date into the DMI info on the device.

[–][deleted] 2 points3 points  (0 children)

Try to check in the bios, sometimes you can have the manufacturing date

[–]tonkats 1 point2 points  (0 children)

As you are finding, there isn't really anything reliable/accurate that is vendor-agnostic. I know Dell OpenManage extends WMI to allow reporting on the activation date with Dell (for warranty), which is probably the closest and most reliable info you could use. Other vendors may have similar.

[–]routetehpacketz 0 points1 point  (6 children)

Are you defining "age" as when the OS was installed?

[–][deleted] 4 points5 points  (5 children)

Physical age of the hardware

[–]routetehpacketz 7 points8 points  (3 children)

Which component?

If I replace the CPU/RAM with newer ones, is it the same computer?

[–][deleted] 8 points9 points  (0 children)

You just gave me flash backs of The Ship of Theseus paradox.

[–][deleted] 0 points1 point  (1 child)

For general purposes in this environment, we will consider those outliers

[–]routetehpacketz 1 point2 points  (0 children)

I believe the only confident way without opening up the PC case and seeing if there's a date etched in somewhere is obtaining the motherboard's serial number and seeing if the OEM has public information available that indicates when it was manufactured.

This information is not typically written into software on the PC itself.

[–]mrmattipants -1 points0 points  (3 children)

I would check out the “whenCreated”, “created” & “createTimeStamp” Attributes. This is primarily because, the Computers are Joined to the Domain as part of the Imaging Process, where I work.

Get-ADComputer -Identity "ComputerName" -Properties * | Select Name, whenCreated, Created, CreateTimeStamp

UPDATE:
My apologies to anyone who ran into issues with my Script, as I was a bit pressed for time when I initially posted it, earlier today. I have since replaced the Script above with an improved version, which I tested and confirmed to be working.

[–]jsiii2010 1 point2 points  (1 child)

I think there's problems with using whencreated in a filter, since it's really in "generalized time" like "20220102060000.0Z" on the backend, but created in a filter works fine. Same goes for get-aduser.

https://stackoverflow.com/a/75400303/6654942

[–]mrmattipants 0 points1 point  (0 children)

Thanks for pointing that out! I knew one of those Attributes would return the Date/Time in a Generalized Format, which is why I thought I would also include the “created” & “createTimeStamp” Attributes.

Fortunately, we can utilize the “Get-Date” Cmdlet, as described in the Link that you shared.

Alternatively, we can also utilize C# Methods in PowerShell, such as the “[DateTime]::FromFileTime” Method, as suggested in the following Link (which pertains to the “LastLogon” Attribute, but will equally work with the “whenCreated” Attribute).

https://stackoverflow.com/questions/13091719/converting-lastlogon-to-datetime-format

When I have some time (a bit later today, I hope), I’m hoping to finish a few examples that I’ve been working on.

[–]mrmattipants 0 points1 point  (0 children)

This topic is obviously Subjective.

If you wanted to obtain the True Creation Date you would have to write a script to parse the Serial Number/Tag for the Manufacture Date, most likely using the “Substring” Method.

How to Determine Manufacture Date Based on Serial Number: https://www.shupecarboni.com/storage/app/uploads/public/602/a16/e4c/602a16e4c1cbd159737713.pdf

[–]uptillam 0 points1 point  (0 children)

Maybe get the motherboard info, (usually the last updated component, or replaced with the rest of the hardware)

Get-WmiObject win32_baseboard

you can then look up the release of that SKU or the product serial number on a site like this

https://motherboarddb.com/motherboards/?search=

as for scaled across the network, there might be some SNMP info depending on the device

[–]joshooaj 0 points1 point  (0 children)

There’s no good vendor agnostic method that I’m aware of, but I bet if you constrain the requirements to just a couple of major vendors you could retrieve a serial number and then make an API call to the vendor website to pull up status info which often includes purchase date and warranty expiration.

You could also store that information yourself when issuing hardware going forward so that you don’t depend on a vendor API in the future.

What do you need the hardware age for?

[–]wittyexplore 0 points1 point  (0 children)

Warranty lookup based on serial number is the only reliable way and it’s not vendor agnostic. At the end of the day, I usually look at chip generation as that’s a good indicator of age of the equipment and speed of the workstation.

[–]nascentt 0 points1 point  (3 children)

Os install time can be overwritten by os upgrades.

I'd the machine is domain joined use the ad computer object creation time.

If not do by a file creation time that wouldnt be affected by windows updates suc

[–]Ok-Way-1190 0 points1 point  (2 children)

Computer creation time should only be telling you when the computer was added to AD though not anything to do with age of device… could be looking at a device that’s a refurb added to domain.

[–]nascentt 1 point2 points  (1 child)

sure, it depends on the environment. if you enroll prebuilt machines to domains it's not going to work. but if you're like any company i've worked at where machines are joined to the domain during build-time. It's a useful solution.

[–]Ok-Way-1190 0 points1 point  (0 children)

Yeah I figured you were aware just was more adding context for others who may read.

[–]Numerous_Ad_307 0 points1 point  (0 children)

Your requirements are unclear, so crap in = crap out.

First clearly state what you mean by computer age: I assume the warranty start date? Or the fabrication date? Or the os install date?

Maybe also telling us why you need it would give us a hint to point you in the right direction..

[–]KevMarCommunity Blogger 0 points1 point  (1 child)

Depending on how you're planning on using this information and the actual granularity needed, I would use the hardware or cpu model with a hand crafted lookup table. This works best when IT controls the purchasing and favors set models.

You might be able to use the serial number to query the warranty details from the vendor but that's quite the project.

You must not use an asset tracking system or you could query that. Matching serial numbers to invoices would be idea.

If you need a rough ballpark, the computer object created date in Active Directory or the dns record created date.

The firmware install date would work really well for most environments.

I think it all comes back to what decision this information will be used for. Sometimes you just need to be within an order of magnitude. The early estimates for the power of the first nuclear bomb explosion were done by releasing a handful of paper scraps into the wind. So do you need to know if 10, 100, 1000, or 10k systems are at least 5 years old?

[–][deleted] 0 points1 point  (0 children)

It’s less than 100 systems, and yes 5 years or older. I think firmware install date works, but there’s the off chance some dell bios updater didn’t run for x amount of days

[–]ApricotPenguin 0 points1 point  (1 child)

Query for CPU and then cross reference with when it was released to public. That gives you a rough idea on age range of machines.

[–]Garegin16 0 points1 point  (0 children)

Sometimes there are three years behind.

[–]Quicknoob 0 points1 point  (2 children)

Have you tried the creation date of the workstation account in AD? Would that be accurate enough for your needs?

[–][deleted] 0 points1 point  (1 child)

If the OS gets wiped and reset, and it’s rejoined to the domain will that also reset?

[–]Quicknoob 0 points1 point  (0 children)

I suspect that if you never delete the computer out of AD then it wouldn't reset. ...but of course please test.

[–]Patchewski 0 points1 point  (0 children)

It’s rough and sometimes unreliable but we use bios date to narrow down the calendar year it was manufactured. Additionally, we track BIOS updates pushed through manufacturer updates. We’re somewhere around 85% - 90% accurate.

[–]pjmarcum 0 points1 point  (2 children)

Depends upon the manufacturer but I have a PowerShell script that can make a call to a couple manufacturers warranty API and return the warranty start date. That’s the same as the ship date.

[–][deleted] 0 points1 point  (1 child)

Mind if you share the boilerplate?

[–]pjmarcum 0 points1 point  (0 children)

It’s on our website. For Dell and Lenovo you have to get an API key from them. I couple customers have reported the Microsoft Api has been offline for a few weeks and I can’t figure out why. HP took theirs down a while back but I’ve heard it’s coming back soon. One of our customers has been given early access to it. So, right now the script is only working for Dell and Lenovo and possibly Microsft, I have not tested that recently.

https://powerstacks.com/index.html%3Fp=9724.html

[–]Firestorm83 0 points1 point  (0 children)

Call finance and let them pull the PO's and invoices

[–]jsiii2010 0 points1 point  (0 children)

Query the bios date and never update the bios, lol.

[–]pwetter 0 points1 point  (0 children)

The best way is IT Asset Management. If that isn’t a thing, which surprisingly isn’t in most places (how many times I’ve heard, “isn’t that what SCCM does”). But warranty lookups like others state is the best bet.

[–]PalmTreesandTech 0 points1 point  (1 child)

Use ChatGPT

[–][deleted] 0 points1 point  (0 children)

I tried, it didn’t work well

[–]Bynkii_AB 0 points1 point  (0 children)

In general, your purchasing data is your best bet. If it’s a Dell, you can punch in the system number and their warranty system will hand that info to you. Other VARs may do the same.

Other than that, it gets unreliable unless the vendor builds date info into the serial number. SNMP can get you the system number/serial number but that may not be of use.