---
updatedAt: 2025-08-14T13:35:54.000Z
agentTools:
  siteIndex: https://developer.n-able.com/llms.txt
  projectIndex: https://developer.n-able.com/n-central/llms.txt
---

# Uptime in Hours

```powershell Automation Policy
<?xml version="1.0" encoding="utf-8" standalone="yes"?><Policy ID="9b86eab0-418f-4bc7-b22f-65628b97306b" Name="Uptime (Hours)" Description="QSBzY3JpcHQgdG8gY2FsY3VsYXRlIGFuZCBkaXNwbGF5IHN5c3RlbSB1cHRpbWUgaW4gaG91cnMsIHJvdW5kZWQgdG8gdGhlIG5lYXJlc3Qgd2hvbGUgbnVtYmVyLg==" Version="2.10.0.19" RemoteCategory="0" ExecutionType="Local" MinimumPSVersionRequired="0.0.0">
  <Object ID="{c0cb83a6-1083-4abd-ab91-0d37f0718db2}" Type="{B6FA6D8B-EEAA-47A6-8463-7F9A4F5BBB6E}" Data="&lt;xml&gt;&lt;OutputParameters&gt;&lt;Parameter ParameterName=&quot;hours&quot; Label=&quot;How many hours has the machine been up (h)&quot; ParameterType=&quot;number&quot; Value=&quot;Run PowerShell Script.hours&quot; /&gt;&lt;/OutputParameters&gt;&lt;/xml&gt;" />
  <LinkManager xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PolicyExecutor">
    <hashset xmlns:d2p1="http://schemas.datacontract.org/2004/07/System">
      <d2p1:TupleOfstringstringstringstring>
        <d2p1:m_Item1>2d569acb-aec6-4a7d-86ee-9e3c210999f4.hours</d2p1:m_Item1>
        <d2p1:m_Item2>OutputObject</d2p1:m_Item2>
        <d2p1:m_Item3></d2p1:m_Item3>
        <d2p1:m_Item4>hours</d2p1:m_Item4>
      </d2p1:TupleOfstringstringstringstring>
    </hashset>
  </LinkManager>
  <Diagnostics OriginalVersion="2.96.0.1" />
  <Activity mc:Ignorable="sads sap" x:Class="Policy Builder" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:p="clr-namespace:PolicyExecutor;assembly=PolicyExecutionEngine" xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <x:Members>
      <x:Property Name="PolicyGUID" Type="InArgument(x:String)" />
    </x:Members>
    <sap:VirtualizedContainerService.HintSize>490,571</sap:VirtualizedContainerService.HintSize>
    <mva:VisualBasic.Settings>Assembly references and imported namespaces serialized as XML namespaces</mva:VisualBasic.Settings>
    <p:PolicySequence DisplayName="Policy Builder" sap:VirtualizedContainerService.HintSize="490,571" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
      <p:PolicySequence.Activities>
        <p:RunPowerShellScript AssemblyName="PolicyExecutionEngine, Version=2.96.0.1, Culture=neutral, PublicKeyToken=null" DisplayName="Run PowerShell Script" sap:VirtualizedContainerService.HintSize="454,348" Moniker="2d569acb-aec6-4a7d-86ee-9e3c210999f4" OutPut_64="[RunPowerShellScript_OutPut_64]" Result="[RunPowerShellScript_Result]" ResultString="[RunPowerShellScript_ResultString]" Results_x64="[RunPowerShellScript_Results_x64]" RunAsCurrentLoggedOnUser="False" ScriptExecutionMethod="ExecuteDebug" TypeName="RunPowerShellScript" genArgEvent="cdf93165-25d2-4d2d-bc79-0d67d3c53a67" m_bTextLinkChange="False" script="IwAgAEcAZQB0ACAAdABoAGUAIABsAGEAcwB0ACAAYgBvAG8AdAAgAHQAaQBtAGUAIAB1AHMAaQBuAGcAIABXAE0ASQANAAoAJABsAGEAcwB0AEIAbwBvAHQAVABpAG0AZQAgAD0AIAAoAEcAZQB0AC0AQwBpAG0ASQBuAHMAdABhAG4AYwBlACAALQBDAGwAYQBzAHMATgBhAG0AZQAgAFcAaQBuADMAMgBfAE8AcABlAHIAYQB0AGkAbgBnAFMAeQBzAHQAZQBtACkALgBMAGEAcwB0AEIAbwBvAHQAVQBwAFQAaQBtAGUADQAKAA0ACgAjACAARwBlAHQAIAB0AGgAZQAgAGMAdQByAHIAZQBuAHQAIAB0AGkAbQBlAA0ACgAkAGMAdQByAHIAZQBuAHQARABhAHQAZQBUAGkAbQBlACAAPQAgAEcAZQB0AC0ARABhAHQAZQANAAoADQAKACMAIABDAGEAbABjAHUAbABhAHQAZQAgAHQAaABlACAAdQBwAHQAaQBtAGUAIABiAHkAIABzAHUAYgB0AHIAYQBjAHQAaQBuAGcAIAB0AGgAZQAgAGwAYQBzAHQAIABiAG8AbwB0ACAAdABpAG0AZQAgAGYAcgBvAG0AIAB0AGgAZQAgAGMAdQByAHIAZQBuAHQAIAB0AGkAbQBlAA0ACgAkAHUAcAB0AGkAbQBlACAAPQAgACQAYwB1AHIAcgBlAG4AdABEAGEAdABlAFQAaQBtAGUAIAAtACAAJABsAGEAcwB0AEIAbwBvAHQAVABpAG0AZQANAAoADQAKACMAIABDAGEAbABjAHUAbABhAHQAZQAgAHQAaABlACAAdABvAHQAYQBsACAAbgB1AG0AYgBlAHIAIABvAGYAIABoAG8AdQByAHMAIABmAHIAbwBtACAAdABoAGUAIAB1AHAAdABpAG0AZQAgAGEAbgBkACAAcgBvAHUAbgBkACAAdABvACAAdABoAGUAIABuAGUAYQByAGUAcwB0ACAAdwBoAG8AbABlACAAbgB1AG0AYgBlAHIADQAKACQAdABvAHQAYQBsAEgAbwB1AHIAcwAgAD0AIABbAG0AYQB0AGgAXQA6ADoAUgBvAHUAbgBkACgAJAB1AHAAdABpAG0AZQAuAFQAbwB0AGEAbABIAG8AdQByAHMAKQANAAoADQAKACQAaABvAHUAcgBzACAAPQAgACQAdABvAHQAYQBsAEgAbwB1AHIAcwA=">
          <p:RunPowerShellScript.InArgs>
            <scg:Dictionary x:TypeArguments="x:String, p:InArg" />
          </p:RunPowerShellScript.InArgs>
          <p:RunPowerShellScript.OutArgs>
            <p:OutArg x:Key="hours" ArgType="number" DisplayName="hours" Name="hours">
              <p:OutArg.Arg>
                <OutArgument x:TypeArguments="x:Double">[RunPowerShellScript_hours]</OutArgument>
              </p:OutArg.Arg>
            </p:OutArg>
          </p:RunPowerShellScript.OutArgs>
        </p:RunPowerShellScript>
      </p:PolicySequence.Activities>
      <p:PolicySequence.Variables>
        <Variable x:TypeArguments="x:String" Name="RunPowerShellScript_OutPut_64" />
        <Variable x:TypeArguments="x:String" Name="RunPowerShellScript_ResultString" />
        <Variable x:TypeArguments="scg:IEnumerable(x:Object)" Name="RunPowerShellScript_Results_x64" />
        <Variable x:TypeArguments="x:Double" Name="RunPowerShellScript_Result" />
        <Variable x:TypeArguments="x:Double" Name="RunPowerShellScript_hours" />
      </p:PolicySequence.Variables>
    </p:PolicySequence>
  </Activity>
</Policy>
```

```json Response Example
{"success":true}
```

# SCRIPT