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

# Is Computer in Safe Mode

```powershell Automation Policy
<?xml version="1.0" encoding="utf-8" standalone="yes"?><Policy ID="0bee568b-7092-4549-b4e1-0dfb29ed1f7b" Name="Is computer in safe mode" Description="aXMgY29tcHV0ZXIgaW4gc2FmZSBtb2Rl" Version="2.19.0.1" MinRequiredVersion="2.19.0.1" RemoteCategory="0" ExecutionType="Local" MinimumPSVersionRequired="0.0.0">
  <Object ID="{5a419f70-d7fb-45e3-92d1-a4f814fba80a}" Type="{B6FA6D8B-EEAA-47A6-8463-7F9A4F5BBB6E}" Data="&lt;xml&gt;&lt;OutputParameters&gt;&lt;Parameter ParameterName=&quot;outcompmode&quot; Label=&quot;Computer Boot State&quot; ParameterType=&quot;string&quot; Value=&quot;Global Variables.BootState&quot; /&gt;&lt;/OutputParameters&gt;&lt;GlobalVariables&gt;&lt;Parameter ParameterName=&quot;gvbootstate&quot; Label=&quot;BootState&quot; ParameterType=&quot;string&quot; Value=&quot;Normal Mode&quot; /&gt;&lt;/GlobalVariables&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>GlobalVariable.gvbootstate</d2p1:m_Item1>
        <d2p1:m_Item2>OutputObject</d2p1:m_Item2>
        <d2p1:m_Item3></d2p1:m_Item3>
        <d2p1:m_Item4>outcompmode</d2p1:m_Item4>
      </d2p1:TupleOfstringstringstringstring>
    </hashset>
  </LinkManager>
  <Diagnostics OriginalVersion="2.80.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,1216</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,1216" MinRequiredVersion="2.19.0.1" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
      <p:PolicySequence.Activities>
        <p:RunPowerShellScript AssemblyName="PolicyExecutionEngine, Version=2.60.0.3, Culture=neutral, PublicKeyToken=null" DisplayName="Run PowerShell Script" sap:VirtualizedContainerService.HintSize="454,348" MinRequiredVersion="2.10.0.19" Moniker="a1df4473-a405-45bd-9d97-665ec617d413" OutPut_64="[RunPowerShellScript_OutPut_64]" Result="[RunPowerShellScript_Result]" ResultString="[RunPowerShellScript_ResultString]" Results_x64="[RunPowerShellScript_Results_x64]" RunAsCurrentLoggedOnUser="False" ScriptExecutionMethod="ExecuteDebug" TypeName="RunPowerShellScript" genArgEvent="f09eff15-f547-4fca-b785-dfdc86e6ec59" m_bTextLinkChange="False" script="JABjAG8AbQBwAHUAdABlAHIAbQBvAGQAZQAgAD0AIABnAHcAbQBpACAAdwBpAG4AMwAyAF8AYwBvAG0AcAB1AHQAZQByAHMAeQBzAHQAZQBtACAAfAAgAHMAZQBsAGUAYwB0ACAAQgBvAG8AdAB1AHAAUwB0AGEAdABlAA0ACgAkAGMAbwBtAHAAdQB0AGUAcgBtAG8AZABlACAADQAKAA0ACgAgACQAbwB1AHQAcwBhAGYAZQAgAD0AIAAkAGMAbwBtAHAAdQB0AGUAcgBtAG8AZABlACAA">
          <p:RunPowerShellScript.InArgs>
            <scg:Dictionary x:TypeArguments="x:String, p:InArg" />
          </p:RunPowerShellScript.InArgs>
          <p:RunPowerShellScript.OutArgs>
            <p:OutArg x:Key="outsafe" ArgType="string" DisplayName="outsafe" Name="outsafe">
              <p:OutArg.Arg>
                <OutArgument x:TypeArguments="x:String">[RunPowerShellScript_outsafe]</OutArgument>
              </p:OutArg.Arg>
            </p:OutArg>
          </p:RunPowerShellScript.OutArgs>
        </p:RunPowerShellScript>
        <p:IfObject CaseSensitive_Item="{x:Null}" CaseSensitive_ItemProp="{x:Null}" Condition_Item="{x:Null}" Condition_ItemProp="{x:Null}" Value_Item="{x:Null}" Value_ItemProp="{x:Null}" Variable_Item="{x:Null}" Variable_ItemProp="{x:Null}" VerboseOutput_Item="{x:Null}" VerboseOutput_ItemProp="{x:Null}" AssemblyName="PolicyExecutionEngine, Version=2.80.0.1, Culture=neutral, PublicKeyToken=null" CaseSensitive="False" CaseSensitive_DisplayArg="false" Condition="contains" Condition_DisplayArg="contains" DisplayName="If" sap:VirtualizedContainerService.HintSize="454,605" MinRequiredVersion="2.19.0.1" Moniker="f4aa7a08-4862-4eb6-a60d-f1e228966f55" Result="[IfObject_Result]" ResultString="[IfObject_ResultString]" RunAsCurrentLoggedOnUser="False" ScriptExecutionMethod="None" TypeName="IfObject" Value_DisplayArg="safe" Value_Type="x:String" Variable="[RunPowerShellScript_outsafe]" Variable_DisplayArg="Run PowerShell Script.outsafe" Variable_Type="x:String" VerboseOutput="False" VerboseOutput_DisplayArg="" m_bTextLinkChange="False">
          <p:IfObject.IfOption>
            <p:SequenceActivity DisplayName="Then" sap:VirtualizedContainerService.HintSize="382,332" Name="SequenceActivity">
              <p:SequenceActivity.Activities>
                <p:Assignment Value_Item="{x:Null}" Value_ItemProp="{x:Null}" Variable_Item="{x:Null}" Variable_ItemProp="{x:Null}" AssemblyName="PolicyExecutionEngine, Version=2.80.0.1, Culture=neutral, PublicKeyToken=null" DisplayName="Global Variable Assignment" sap:VirtualizedContainerService.HintSize="344,182" MinRequiredVersion="2.10.0.19" Moniker="5f22e241-0389-4ef0-a646-921da56bd984" Result="[Assignment_Result]" ResultString="[Assignment_ResultString]" RunAsCurrentLoggedOnUser="False" ScriptExecutionMethod="None" TypeName="Assignment" Value_DisplayArg="Safe Mode" Value_Type="x:String" Variable="[gvbootstate]" Variable_DisplayArg="Global Variables.BootState" Variable_Type="x:String" m_bTextLinkChange="False">
                  <p:Assignment.Value>
                    <InArgument x:TypeArguments="x:Object">
                      <p:ObjectLiteral Value="Safe Mode" />
                    </InArgument>
                  </p:Assignment.Value>
                </p:Assignment>
              </p:SequenceActivity.Activities>
              <p:SequenceActivity.Variables>
                <Variable x:TypeArguments="x:String" Name="Assignment_ResultString" />
                <Variable x:TypeArguments="x:Double" Name="Assignment_Result" />
              </p:SequenceActivity.Variables>
            </p:SequenceActivity>
          </p:IfObject.IfOption>
          <p:IfObject.Value>
            <InArgument x:TypeArguments="x:Object">
              <p:ObjectLiteral Value="safe" />
            </InArgument>
          </p:IfObject.Value>
        </p:IfObject>
      </p:PolicySequence.Activities>
      <p:PolicySequence.Variables>
        <Variable x:TypeArguments="x:String" Name="RunPowerShellScript_OutPut_64" />
        <Variable x:TypeArguments="x:Double" Name="RunPowerShellScript_Result" />
        <Variable x:TypeArguments="x:String" Name="RunPowerShellScript_ResultString" />
        <Variable x:TypeArguments="scg:IEnumerable(x:Object)" Name="RunPowerShellScript_Results_x64" />
        <Variable x:TypeArguments="x:String" Name="RunPowerShellScript_outsafe" />
        <Variable x:TypeArguments="x:String" Default="Normal Mode" Name="gvbootstate" />
        <Variable x:TypeArguments="x:Double" Name="IfObject_Result" />
        <Variable x:TypeArguments="x:String" Name="IfObject_ResultString" />
      </p:PolicySequence.Variables>
    </p:PolicySequence>
  </Activity>
</Policy>
```

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

# SCRIPT