ServiceNow Operational State Change

Hi all,

When a ServiceNow instance in Orion automatically changes to a Restricted state do you have to manually change this back to Enabled or should it automatically revert to Enabled?

Thanks

Top Replies

Parents Reply Children
  • , is referring to changing it via a PowerShell script against SW using SWIS. The table you'd have to modify is Orion.ESI.IncidentService. The below script should be able to get you started.

    # Import SolarWinds Module
    import-Module SwisPowerShell
    
    $integrations = Get-SwisData $swis -query "SELECT InstanceID, Type, Name, Url, CredentialID, OperationalState, Status, DetailsUrl, CustomData, DisplayName, Description, InstanceType, Uri, InstanceSiteId
    FROM Orion.ESI.IncidentService
    WHERE Status like '%Restricted%'"
    
    #Iterates through returned list of Restricted Integrations and set Status to Enabled
    foreach ($integration in $integrations){
      $update =@{
        Status = 'Enabled'
      }
      Write-Output "Setting Integration: $integration.Name from $integration.Status to Enabled"
      Set-SwisObject $swis -Uri $integration.uri -Properties $update
      }
    }

  • My powershell is triggered from an alert which detects the Operational Status and then executes:

    Invoke-SwisVerb $swis Orion.Reporting ExecuteSQL @("UPDATE ESI_Instance SET OperationalState = 2 WHERE Name = 'NameOfTheIntegration'")

    's solution looks far more elegant.

  • Thanks for your help I did not get the chance to try it I will work on this next week