Forum Discussion

M. Sheeraz Ansari.'s avatar
M. Sheeraz Ansari.
Brass Contributor
Sep 20, 2022

Windows Server Uptime in last 30 days

Hi,   For a customer, I am trying to compile a report for Windows Servers uptime in last 30 days. Please see attached PowerShell script that has helped me but this script gives us time since the se...
  • M. Sheeraz Ansari.'s avatar
    M. Sheeraz Ansari.
    Sep 22, 2022
    Thanks Harm_Veenstra

    I tried your suggested changes but it still returns zero result.... meaning, script runs and scans the list but no list of server in result.

    Well, I tried if condition below - it gives us required result that we needed. Thanks.
    (If ($span.TotalDays -ge 31) { continue })

    <#==================
    Create Output List
    ====================#>
    $OutputObj | Add-Member -MemberType NoteProperty -Name Uptime -Value $Uptime
    $Status=1
    $SuccessCount++
    If ($span.TotalDays -ge 31) { continue }

Resources