Scripts runs successfully but no changes reflects in ServiceNow

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Sachin Panchal Sachin Panchal 5 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #37400
    Profile photo of Sachin Panchal
    Sachin Panchal
    Participant

    I am able to run below powershell scrip using windows powershell and it works fine and the description field are getting updated in serviceNow.If i run the same script using PowerShell integration pack in orchestrator, it completes successfully, but description field are not getting updated
    .$username = "sco"
    $password = "xxxx"
    $instance = "demo009"
    $cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))

    $sn = New-WebServiceProxy -Uri https://MyTest.service-now.com/incident.do?WSDL – -Credential $cred

    #get autogenerated namespace
    $type = $sn.GetType().Namespace

    $get = new-object ($type + '.get')
    $getRecords = new-object ($type + '.getRecords')
    $update = new-object ($type + '.update')

    #Update a record with values
    $update.sys_id="bcaebcc70fae5e00e57d4cace1050ec8"
    $update.description="SCO 2 is working on this ticket Reset Password"
    $sn.update($update)

    #37407
    Profile photo of Richard Diphoorn
    Richard Diphoorn
    Participant

    I suggest you to post the question in the Orchestrator forum here: https://social.technet.microsoft.com/Forums/en-US/home?category=systemcenterorchestrator

    #37628
    Profile photo of Mark Prior
    Mark Prior
    Participant

    Orchestrator is strange how it reports the success of the script, and general use of powershell out of the box is quite bad as it is locked to v2

    take a look at this, it has been invaluble for me, sets the default powershell within orchestrator to V4, (obviously you need to install etc.. )

    http://www.sc-orchestrator.eu/index.php/scoblog/128-run-the-powershell-version-of-windows-executing-the-orchestrator-runbook-service-in-run-net-script-activity

    #37629
    Profile photo of Sachin Panchal
    Sachin Panchal
    Participant

    Hello Richard/Mark,

    Thank you for the reply, I was able to resolve the issue. The issue was with one extra hypen(-) in the command New-WebServiceProxy.

    Thanks
    Sachin

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.