<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Replicate .NET API Resume Task in Powershell in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-NET-API-Resume-Task-in-Powershell/m-p/2534107#M15337</link>
    <description>&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;Import-Module Attunity -Force

$aemHostName = "REDACTED"
$plaincred = Get-AttunityUserInfo -ServerInstance REDACTED -Databasename REDACTED

$pw = $plaincred.UserPW
$uname = $plaincred.UserID

$password = ConvertTo-SecureString $pw -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($uname, $password)

$client = Get-AttunityClient -Credential $Cred -aemHost $aemHostName

# Set variable to hold one or more replicate servers
$replservers = @()

# Return one or more replicate servers only from "Production"
$replservers += $client.GetServerList().ServerList | Where-Object {$_.Description -like "*Prod*"}

foreach ($server in $replservers)
{

    # Get the task list for the first replicate server
    $taskList = $client.GetTaskList($server.Name)
    $taskLatencies = @()


    Add-Type -path "C:\Program Files\WindowsPowerShell\Modules\Attunity\0.0.4\aem\clients\dotnet\AemRestClient.dll"
    $options = New-Object Attunity.Aem.RestClient.Models.AemRunTaskOptions

    foreach ($task in $taskList.TaskList) {
        $taskDetails = $client.GetTaskDetails($replservers[0].Name, $task.Name)
        $taskLatencies += $taskDetails | Select-Object Name,@{Name="TotalLatency"; Expression={$_.CDCLatency.TotalLatency}}
        if ($task.Name -eq "SQL_RELYENCE") {
            
            Write-Host "STOPPING TASK $($task.Name)"
            $client.StopTask($server.Name, $task.Name,30)
            

            Write-Host "STARTING TASK $($task.Name)"
            # Use the correct AemRunTaskOptions enum for RESUME_PROCESSING
            $option= $options::RESUME_PROCESSING
            # Run the task with the correct option
            $client.RunTask($server.Name, $task.Name,$option)

    }
}

}&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;P&gt;# Use the correct AemRunTaskOptions enum for RESUME_PROCESSING&lt;BR /&gt;$option= &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;$options::RESUME_PROCESSING&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;# Run the task with the correct option&lt;BR /&gt;$client.RunTask($server.Name, $task.Name,$option)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above snippet in .NET we are trying to resume the tack but getting the following error:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Cannot find an overload for "RunTask" and the argument count: "3".&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;At C:\Users\bh48250_a\Documents\powershell\GetAEMData.ps1:44 char:13&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;+ $client.RunTask($server.Name, $task.Name,$option)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;+ CategoryInfo : NotSpecified: (:) [], MethodException&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;+ FullyQualifiedErrorId : MethodCountCouldNotFindBest&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The sdk reference for RunTask() is as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/enterprise-manager/May2025/Content/EnterpriseManager/EnterpriseManager_APIGuide/NetAPI/api_runTask.htm" target="_blank" rel="noopener"&gt;RunTask | Qlik Enterprise Manager Help&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looking to just resume processing on a task via the API.&amp;nbsp; documentation says that the&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 id="anchor-1" tabindex="-1"&gt;Syntax&lt;/H2&gt;
&lt;P class="Code"&gt;public AemRunTaskResp RunTask(&lt;/P&gt;
&lt;P class="Code"&gt;AemRunTaskReq payload,&lt;/P&gt;
&lt;P class="Code"&gt;string server,&lt;/P&gt;
&lt;P class="Code"&gt;string task,&lt;/P&gt;
&lt;P class="Code"&gt;AemRunTaskOptions option = AemRunTaskOptions.&lt;SPAN class="user_input"&gt;Option&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P class="Code"&gt;int timeout = 30&lt;/P&gt;
&lt;P class="Code"&gt;);&lt;/P&gt;
&lt;P class="Code"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="Code"&gt;I the payload for&amp;nbsp;AemRunTaskReq looks like it shouldnt be required for resume processing.&amp;nbsp; Looking for a decent example of resuming a task via .net API&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Oct 2025 14:56:44 GMT</pubDate>
    <dc:creator>nathanbell</dc:creator>
    <dc:date>2025-10-22T14:56:44Z</dc:date>
    <item>
      <title>Replicate .NET API Resume Task in Powershell</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-NET-API-Resume-Task-in-Powershell/m-p/2534107#M15337</link>
      <description>&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;Import-Module Attunity -Force

$aemHostName = "REDACTED"
$plaincred = Get-AttunityUserInfo -ServerInstance REDACTED -Databasename REDACTED

$pw = $plaincred.UserPW
$uname = $plaincred.UserID

$password = ConvertTo-SecureString $pw -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($uname, $password)

$client = Get-AttunityClient -Credential $Cred -aemHost $aemHostName

# Set variable to hold one or more replicate servers
$replservers = @()

# Return one or more replicate servers only from "Production"
$replservers += $client.GetServerList().ServerList | Where-Object {$_.Description -like "*Prod*"}

foreach ($server in $replservers)
{

    # Get the task list for the first replicate server
    $taskList = $client.GetTaskList($server.Name)
    $taskLatencies = @()


    Add-Type -path "C:\Program Files\WindowsPowerShell\Modules\Attunity\0.0.4\aem\clients\dotnet\AemRestClient.dll"
    $options = New-Object Attunity.Aem.RestClient.Models.AemRunTaskOptions

    foreach ($task in $taskList.TaskList) {
        $taskDetails = $client.GetTaskDetails($replservers[0].Name, $task.Name)
        $taskLatencies += $taskDetails | Select-Object Name,@{Name="TotalLatency"; Expression={$_.CDCLatency.TotalLatency}}
        if ($task.Name -eq "SQL_RELYENCE") {
            
            Write-Host "STOPPING TASK $($task.Name)"
            $client.StopTask($server.Name, $task.Name,30)
            

            Write-Host "STARTING TASK $($task.Name)"
            # Use the correct AemRunTaskOptions enum for RESUME_PROCESSING
            $option= $options::RESUME_PROCESSING
            # Run the task with the correct option
            $client.RunTask($server.Name, $task.Name,$option)

    }
}

}&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;P&gt;# Use the correct AemRunTaskOptions enum for RESUME_PROCESSING&lt;BR /&gt;$option= &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;$options::RESUME_PROCESSING&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;# Run the task with the correct option&lt;BR /&gt;$client.RunTask($server.Name, $task.Name,$option)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above snippet in .NET we are trying to resume the tack but getting the following error:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Cannot find an overload for "RunTask" and the argument count: "3".&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;At C:\Users\bh48250_a\Documents\powershell\GetAEMData.ps1:44 char:13&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;+ $client.RunTask($server.Name, $task.Name,$option)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;+ CategoryInfo : NotSpecified: (:) [], MethodException&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;+ FullyQualifiedErrorId : MethodCountCouldNotFindBest&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The sdk reference for RunTask() is as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/enterprise-manager/May2025/Content/EnterpriseManager/EnterpriseManager_APIGuide/NetAPI/api_runTask.htm" target="_blank" rel="noopener"&gt;RunTask | Qlik Enterprise Manager Help&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looking to just resume processing on a task via the API.&amp;nbsp; documentation says that the&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 id="anchor-1" tabindex="-1"&gt;Syntax&lt;/H2&gt;
&lt;P class="Code"&gt;public AemRunTaskResp RunTask(&lt;/P&gt;
&lt;P class="Code"&gt;AemRunTaskReq payload,&lt;/P&gt;
&lt;P class="Code"&gt;string server,&lt;/P&gt;
&lt;P class="Code"&gt;string task,&lt;/P&gt;
&lt;P class="Code"&gt;AemRunTaskOptions option = AemRunTaskOptions.&lt;SPAN class="user_input"&gt;Option&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P class="Code"&gt;int timeout = 30&lt;/P&gt;
&lt;P class="Code"&gt;);&lt;/P&gt;
&lt;P class="Code"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="Code"&gt;I the payload for&amp;nbsp;AemRunTaskReq looks like it shouldnt be required for resume processing.&amp;nbsp; Looking for a decent example of resuming a task via .net API&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2025 14:56:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-NET-API-Resume-Task-in-Powershell/m-p/2534107#M15337</guid>
      <dc:creator>nathanbell</dc:creator>
      <dc:date>2025-10-22T14:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate .NET API Resume Task in Powershell</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-NET-API-Resume-Task-in-Powershell/m-p/2534174#M15344</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please open a SalesForce case for your issue and attach to the case the details + the script you are using so that support team will be able to review it and see if there is any issue with it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;
&lt;P&gt;Orit&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2025 07:44:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-NET-API-Resume-Task-in-Powershell/m-p/2534174#M15344</guid>
      <dc:creator>OritA</dc:creator>
      <dc:date>2025-10-23T07:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Replicate .NET API Resume Task in Powershell</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Replicate-NET-API-Resume-Task-in-Powershell/m-p/2534577#M15366</link>
      <description>&lt;P&gt;I will get a case opened but for one reason or another the REST method works just fine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;https://&lt;/SPAN&gt;&lt;SPAN class="syntax"&gt;{host}&lt;/SPAN&gt;&lt;SPAN&gt;/attunityenterprisemanager/api/v1/servers/&lt;/SPAN&gt;&lt;SPAN class="syntax"&gt;{ServerName}&lt;/SPAN&gt;&lt;SPAN&gt;/tasks/&lt;/SPAN&gt;&lt;SPAN class="syntax"&gt;{TaskName}&lt;/SPAN&gt;&lt;SPAN&gt;?action=run&amp;amp;option=&lt;/SPAN&gt;&lt;SPAN class="syntax"&gt;RESUME_PROCESSING&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 14:00:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Replicate-NET-API-Resume-Task-in-Powershell/m-p/2534577#M15366</guid>
      <dc:creator>nathanbell</dc:creator>
      <dc:date>2025-10-28T14:00:51Z</dc:date>
    </item>
  </channel>
</rss>

