Get System Install Date

Gets the system installation date. The script accepts input from the pipeline.

 
 
 
 
 
4.7 Star
(3)
Add to favorites
Operating System
5/8/2010
E-mail Twitter del.icio.us Digg Facebook
  • Can this be run against a domain OU
    1 Posts | Last post May 04, 2017
    • Hello, do you have a version that I can run against a domain OU and query every machine in that OU? 
  • I get an error... What shall I do? Thx!
    2 Posts | Last post January 30, 2014
    • Cannot convert value "20121211102032.000000-480" to type "System.DateTime". Error: "String was not recognized as a valid 
      DateTime."
      At C:\Users\garzaje\Desktop\GetInstallDate.ps1:38 char:3
      +         $Report.InstallDate = [datetime] (Get-WmiObject -Class Win32_OperatingSystem - ...
      +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
          + FullyQualifiedErrorId : InvalidCastParseTargetInvocationWithFormatProvider
    • Slight alteration to the function can fix that.
      
          function Get-SystemInstallDateForOneSystem { 
              param ([string] $ComputerName = '.') 
              $Report = "" | Select-Object -property Computer,InstallDate 
              $Report.Computer = $ComputerName 
      		$WMIObj = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $ComputerName
              $Report.InstallDate =  $WMIObj.ConvertToDateTime($WMIObj.InstallDate)
              $Report 
          }