Skip to main content

OS Install Date

Summary

This agent procedure runs PowerShell to determine the initial install date of the OS. This always pulls the oldest version and will not be overwritten with feature updates or upgrades to a new OS.

Example Agent Procedure Log

TimeActionStatusUser
4:22:46 pm 13-Apr-23OS Install DateSuccess THENderek.joniak
4:22:46 pm 13-Apr-23OS Install DateOS Install Date: 03/29/2022derek.joniak
4:22:46 pm 13-Apr-23Execute Powershell Command (64-bit, Run As System)Success THENderek.joniak
4:22:46 pm 13-Apr-23Execute Powershell Command (64-bit, Run As System)-0016Powershell command complete. Results returned to global variable #global:psresult# and saved in Agent's Documents tab of server.derek.joniak
4:22:46 pm 13-Apr-23Execute Powershell Command (64-bit, Run As System)-0016Informational: GetFile command overwrote the server file C:/Kaseya/UserProfiles/211658173702177/GetFiles/../docs/psoutput.txt with the new contents from c:/kworking/psoutput.txt in THEN step 3.derek.joniak
4:22:44 pm 13-Apr-23Execute Powershell Command (64-bit, Run As System)-0011Executing 64-bit Powershell command as System: "" -command "$OS=@(Get-ChildItem -Path 'HKLM:/System/Setup/Source*'ForEach-Object {Get-ItemProperty -Path Registry::$_})+@(Get-ItemProperty 'HKLM:/SOFTWARE/Microsoft/Windows NT/CurrentVersion')
4:22:44 pm 13-Apr-23Execute Powershell Command (64-bit, Run As System)-0013Sending output to global variable.derek.joniak
4:22:44 pm 13-Apr-23Execute Powershell Command (64-bit, Run As System)-0008Custom commands detected as $OS=@(Get-ChildItem -Path 'HKLM:/System/Setup/Source*'ForEach-Object {Get-ItemProperty -Path Registry::$_})+@(Get-ItemProperty 'HKLM:/SOFTWARE/Microsoft/Windows NT/CurrentVersion')
4:22:44 pm 13-Apr-23Execute Powershell Command (64-bit, Run As System)-0003No Powershell file variable detected.derek.joniak
4:22:42 pm 13-Apr-23Execute Powershell Command (64-bit, Run As System)-0002Powershell is present.derek.joniak
4:22:42 pm 13-Apr-23OS Install DateDetecting OS Install Datederek.joniak
4:22:35 pm 13-Apr-23Run Now - OS Install DateAdmin derek.joniak scheduled procedure Run Now - OS Install Date to run at Apr 13 2023 5:22 PMderek.joniak

Dependencies

The agent procedure requires the custom field to be created in order to successfully run:
Custom Field Documentation

Output

The agent procedure updates the custom field.