It has been a while, but more posts will come soon.
For now, an easier one that has more informational value than any actual use.
Ever felt like you wanted to know how old the workstation is of a customer? Or how long that old physical server has been standing there?
Now you might be able to figure that out using Powershell.
When will it show the correct date and when not?
It will show the correct date even when:
- it has upgraded the OS
- Drives on a disk has been wiped, but not the full disk itself
It might not show the correct date when:
- The disk has been fully formatted/wiped to the point of complete blank re-installation
- The device is using an OS older than Windows 10 or Server 2016 and has had BIOS updates multiple times (Only a chance)
The reason for the above is simple to explain. On Windows 8 and older or Server 2012 and older, you can only use WMI to find the installation date. However, while unaffected by upgrades, it sometimes gets affected by BIOS updates.
There is no easy to circumvent this. The closest possible option would be to check the manufacturing date of hardware parts however with replacements etc. this can only cause more confusion.
Below in the codeblock can be seen how it retrieves this information.
It checks what Windows version is being used.
If Windows 10+ or Server 2016+ it will check the specific registry key and retrieve the date information from this.
If older than Windows 10 or Server 2016, it will use a basic WMI command to retrieve the original install date from the BIOS.
Because of me being a European, I afterwards let it adjust the date to the day-month-year format.
This can be adjusted depending on your wish.
While it is not a script that can fix issues or change anything, it has its uses for informational use.
Whether it is just for yourself or a pointer regarding warranty.
More good stuff hopefully coming soon!
Categories: Powershell, Windows, Server, Workstation, Script
Patrick Berger AKA Powershellder.
[ i ] Parallax section below. Click on the section below to upload image. Don't worry if it looks weird in the Weebly editor. It'll look normal on your published site.
To edit or delete your image, press the "toggle" button below. Then, hover over your image until a popup appears with the "edit" and "delete" options. If you don't want a white content section, leave it blank. It will disappear on your live website.