Featured Post

Links library


List Version and Reboot Time

s2d.dk is not responsible for any errors, or for the results obtained from the use of this information on s2d.dk. All information in this site is provided as "draft notes" and "as is", with no guarantee of completeness, accuracy, timeliness or of the results obtained from the use of this information. Always test in a lab setup, before use any of the information in production environment. The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

PowerShell Script to list the Windows Version and Last Reboot Time:

List my three S2D Cluster versions and the last reboot time

“Thanks to Steffen Brandsborg, Sentia Denmark for creating the PowerShell used below”

# Cluster S2D01
 $ComputerList = "S046031","S046032","S046033","S046034","S046035","S046036"
# Cluster S2D02
 $ComputerList += "S047027","S047028"
# Cluster S2D03
 $ComputerList += "S048001","S048002","S048003","S048004"

$InvokeResult = invoke-command -ComputerName $ComputerList -ScriptBlock {
    $BuildBranch = (Get-ItemProperty "HKLM:\Software\Microsoft\Windows NT\CurrentVersion").BuildBranch
    $CurrentVersion = (Get-ItemProperty "HKLM:\Software\Microsoft\Windows NT\CurrentVersion").CurrentVersion
    $CurrentBuildNumber = (Get-ItemProperty "HKLM:\Software\Microsoft\Windows NT\CurrentVersion").CurrentBuildNumber
    $UBR = (Get-ItemProperty "HKLM:\Software\Microsoft\Windows NT\CurrentVersion").UBR
    $BootTime = ((Get-WmiObject Win32_OperatingSystem).ConvertToDateTime((Get-WmiObject Win32_OperatingSystem).LastBootUpTime)).ToString("yyyy-MM-dd HH:mm:ss")
    $ProductName = (Get-ItemProperty "HKLM:\Software\Microsoft\Windows NT\CurrentVersion").ProductName

    $Result =  @{
        Computername = $env:COMPUTERNAME
        ProductName = $ProductName
        WindowsVersion = ("$CurrentVersion.$CurrentBuildNumber.$UBR")
        BootTime = $BootTime
    New-Object -TypeName PSObject -Property $Result
$InvokeResult | Sort Computername | Select ComputerName, ProductName, WindowsVersion, BootTime | ft