12 Replies Latest reply on May 6, 2016 2:01 PM by tdanner

    Set-SwisObject : Update or insert of view or function 'dbo.AlertStatusView' failed

    bnbhp0

      Im trying to update Notes field through PS. Can someone help me on this error

       

      # This sample script demonstrates how to set a custom property of a node

      # or an interface using CRUD operations.

      #

      # Please update the hostname and credential setup to match your configuration, and

      # reference to an existing node and interface which custom property you want to set.

       

       

      # Connect to SWIS

      $hostname = "localhost"

      $username = "admin"

      $password = New-Object System.Security.SecureString

      #$password = " "

      $cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $password

      $swis = Connect-Swis -host $hostname -cred $cred

      $uri = 'swis://localhost/Orion/Orion.AlertStatus/AlertDefID=eb3cfefa-710f-4a20-818b-4bd27836b285,ActiveObject="27"'

      $newnote = "This is my new note text."

      Set-SwisObject $swis $uri @{Notes=$newnote}

       

      When i try to execute this PS im getting following error

       

      Set-SwisObject : Update or insert of view or function 'dbo.AlertStatusView' failed because it contains a derived or con

      stant field.

      At C:\CRUD.SettingCustomProperty - test1.ps1:20 char:15

      + Set-SwisObject <<<<  $swis $uri @{Notes=$newnote}

          + CategoryInfo          : InvalidOperation: (:) [Set-SwisObject], FaultException`1

          + FullyQualifiedErrorId : SwisError,SwisPowerShell.SetSwisObject

       

      Thanks

      Banu