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
You have to manually change it back - but you can write a powershell script to do it X minutes after it changes to restricted, based on setting up an alert for the change.
Hi I have been having same issue can you please advise how would you do that with Powershell script I have not been able to find a way to interact with that integration through Powershell
@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 Moduleimport-Module SwisPowerShell$integrations = Get-SwisData $swis -query "SELECT InstanceID, Type, Name, Url, CredentialID, OperationalState, Status, DetailsUrl, CustomData, DisplayName, Description, InstanceType, Uri, InstanceSiteIdFROM Orion.ESI.IncidentServiceWHERE Status like '%Restricted%'"#Iterates through returned list of Restricted Integrations and set Status to Enabledforeach ($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.
Thanks for your help I did not get the chance to try it I will work on this next week