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
lahmad, TimWhite_LC2 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'")
christopher.t.jones123's solution looks far more elegant.
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'")
christopher.t.jones123's solution looks far more elegant.
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.