1 Reply Latest reply on Nov 9, 2018 5:56 AM by cwinning

    Deploying patches via Powershell

    Rapp87 Rookie

      I am using the following code to add some servers to a pre-production group and then want to kick off a scan and then deploy the missing patches to the server. This seems to be working fine if I run the powershell on server which has Ivanti patch management installed however if I try to run the same script by kicking it off from my local machine using either.

       

      Invoke-Command -ComputerName IVANTI01 -ScriptBlock {

       

      Code below

      }

       

      Or when using

      Enter-PSSession -ComputerName IVANTI01

       

      Code below

       

      ***** Working running from local Ivanti patch management server *****

       

      Import-Module STProtect -PassThru

      Write-Host -ForegroundColor Green "Adding server to patch management group"

       

       

      $Csv = @()

       

      $Csv = Import-Csv C:\Scripts\Server_Build_Config_v1.0.csv

       

      $machine = $Csv.Machine

       

      Add-MachineGroupItem -Name Pre-Production -EndpointNames $machine

       

      sleep 5

       

      Write-Host -ForegroundColor Green "Scanning server for security patches"

       

      $PatchScan = Start-PatchScan -EndpointNames $machine -TemplateName "Security Patch Scan"

       

       

      Write-Host -ForegroundColor Yellow "Waiting for scan to complete"

       

      $PatchScan | Wait-PatchScan

       

      Write-Host -ForegroundColor Green "Scan Completed"

       

      Write-Host -ForegroundColor Yellow "Deploying security patches"

       

      $PatchScan | Start-PatchDeploy -TemplateName "No restart"

       

       

       

       

       

       

       

      I am getting the following error message:

       

      Exception calling "QueueAssessment" with "7" argument(s): "There was no endpoint listening at net.pipe://localhost/ST/Console/Engines/EngineOrchestrator/ that could accept the message. This is often caused by an

      incorrect address or SOAP action. See InnerException, if present, for more details."

      At C:\Program Files\LANDESK\Shavlik Protect\PSModules\STProtect\STProtect.PatchScan.psm1:154 char:2

      +     [ST.PSModule.Protect.PatchApiProxy]::QueueAssessment($credentialU ...

      +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

          + FullyQualifiedErrorId : EndpointNotFoundException