<?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 Re: get-ncjob missing job-id and JobName in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-ncjob-missing-job-id-and-JobName/m-p/460402#M7056</link>
    <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure why the Get-NcJob CmdLet is missing the values for Name and ID however you can always revert to using the private REST CLI if there is an issue with a CmdLet. You could query the job via the UUID. EG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;PS C:\Scripts&amp;gt; .\GetJobCli.ps1 -Cluster 192.168.100.2 -JobID 17b165e7-dea3-11ef-8613-00a098bd46e0 -Credential $credentials
Executing Command: job show -uuid 17b165e7-dea3-11ef-8613-00a098bd46e0 -fields id,name
Enumerated Job "17b165e7-dea3-11ef-8613-00a098bd46e0" on cluster "192.168.100.2" using URL: "https://192.168.100.2/api/private/cli/job?uuid=17b165e7-dea3-11ef-8613-00a098bd46e0&amp;amp;fields=id,name"

id vserver name                   uuid
-- ------- ----                   ----
27 svm_01 SnapMirror Service Job 17b165e7-dea3-11ef-8613-00a098bd46e0&lt;/LI-CODE&gt;&lt;P&gt;Here's the example source code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Param(
   [Parameter(Mandatory = $True, HelpMessage = "The name or IP Address of the Cluster")]
   [String]$Cluster,
   [Parameter(Mandatory = $True, HelpMessage = "The Job UUID")]
   [String]$JobID,
   [Parameter(Mandatory = $True, HelpMessage = "The Credentials to authenticate to the Cluster")]
   [System.Management.Automation.PSCredential]$Credential
)
#'------------------------------------------------------------------------------
#'Set the certificate policy and TLS version.
#'------------------------------------------------------------------------------
Add-Type @"
   using System.Net;
   using System.Security.Cryptography.X509Certificates;
   public class TrustAllCertsPolicy : ICertificatePolicy {
   public bool CheckValidationResult(
   ServicePoint srvPoint, X509Certificate certificate,
   WebRequest request, int certificateProblem) {
      return true;
   }
}
"@
#[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
#'------------------------------------------------------------------------------
#'Disable SSL Check.
#'------------------------------------------------------------------------------
$sslHandler = @"
public class SSLHandler{
   public static System.Net.Security.RemoteCertificateValidationCallback GetSSLHandler(){
      return new System.Net.Security.RemoteCertificateValidationCallback((sender, certificate, chain, policyErrors) =&amp;gt; { return true; });
   } 
}
"@
Add-Type -TypeDefinition $sslHandler
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = [SSLHandler]::GetSSLHandler()
#'------------------------------------------------------------------------------
#'Enumerate the Certificates.
#'------------------------------------------------------------------------------
[String]$command = "job show -uuid $JobID -fields id,name"
[String]$uri     = "https://$Cluster/api/private/cli/job?uuid=$JobID&amp;amp;fields=id,name"
Write-Host "Executing Command`: $command"
Try{
   $response = Invoke-RestMethod -Method Get -Uri $uri -Credential $Credential -ErrorAction Stop
}Catch{
   Write-Warning -Message $("Failed Enumerating Job ""$JobID"" on Cluster ""$Cluster"" using URL`: ""$uri"". Error " + $_.Exception.Message)
   Exit -1
}
#'------------------------------------------------------------------------------
#'Exit if there were no records returned.
#'------------------------------------------------------------------------------
If($Null -ne $response -And $response.num_records -eq 0){
   Write-Host "There are no entries matching your query"
   Exit 0
}
#'------------------------------------------------------------------------------
#'Display the Certificates.
#'------------------------------------------------------------------------------
If($Null -ne $response -And $response.num_records -ge 1){
   Write-Host "Enumerated Job ""$JobID"" on cluster ""$Cluster"" using URL`: ""$uri"""
}Else{
   Write-Warning -Message "Failed Enumerating Job ""$JobID"" on cluster ""$Cluster"" using URL`: ""$uri"""
   Exit -1
}
$response.records
#'------------------------------------------------------------------------------&lt;/LI-CODE&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
    <pubDate>Wed, 30 Apr 2025 08:46:32 GMT</pubDate>
    <dc:creator>mbeattie</dc:creator>
    <dc:date>2025-04-30T08:46:32Z</dc:date>
    <item>
      <title>get-ncjob missing job-id and JobName</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-ncjob-missing-job-id-and-JobName/m-p/460400#M7055</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;when running get-ncjob we found, that there are missing information. So essential the Job-ID and JobName.&lt;/P&gt;&lt;P&gt;IsRestarted :&lt;BR /&gt;JobAffinity :&lt;BR /&gt;JobCategory :&lt;BR /&gt;JobCompletion : success&lt;BR /&gt;JobDescription : DELETE /api/storage/volumes/fc72f0e5-1817-11ef-9f60-00a098ff672f/snapshots/d11c4011-28bc-4c8e-9452-93157cf46bb2&lt;BR /&gt;JobDropdeadTime :&lt;BR /&gt;JobDropdeadTimeDT :&lt;BR /&gt;JobEndTime : 1744703715&lt;BR /&gt;JobEndTimeDT : 15.04.2025 09:55:15&lt;BR /&gt;JobId :&lt;BR /&gt;JobName :&lt;BR /&gt;JobNode :&lt;BR /&gt;JobPriority :&lt;BR /&gt;JobProcess :&lt;BR /&gt;JobProgress : success&lt;BR /&gt;JobQueueTime :&lt;BR /&gt;JobQueueTimeDT :&lt;BR /&gt;JobSchedule :&lt;BR /&gt;JobStartTime : 1744703715&lt;BR /&gt;JobStartTimeDT : 15.04.2025 09:55:15&lt;BR /&gt;JobState : success&lt;BR /&gt;JobStatusCode : 0&lt;BR /&gt;JobType :&lt;BR /&gt;JobUsername :&lt;BR /&gt;JobUuid : f73e0950-19ce-11f0-94b4-00a098ff672f&lt;BR /&gt;JobVserver : XXXXXXX&lt;BR /&gt;NcController : XXXXXXXXX&lt;BR /&gt;Error :&lt;BR /&gt;Svm : DataONTAP.C.Types.RestAttributes.Svm&lt;BR /&gt;JobNodeName :&lt;BR /&gt;IsRestartedSpecified : False&lt;BR /&gt;JobDropdeadTimeSpecified : False&lt;BR /&gt;JobEndTimeSpecified : True&lt;BR /&gt;JobIdSpecified : False&lt;BR /&gt;JobQueueTimeSpecified : False&lt;BR /&gt;JobStartTimeSpecified : True&lt;BR /&gt;JobStatusCodeSpecified : True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was in older version not. As we have scripts which bases on this information, these scripts are not running anymore.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas what we can do, to get this run again.&lt;BR /&gt;THX&amp;nbsp;&lt;BR /&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 07:01:04 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-ncjob-missing-job-id-and-JobName/m-p/460400#M7055</guid>
      <dc:creator>MiK1</dc:creator>
      <dc:date>2025-04-30T07:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: get-ncjob missing job-id and JobName</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-ncjob-missing-job-id-and-JobName/m-p/460402#M7056</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure why the Get-NcJob CmdLet is missing the values for Name and ID however you can always revert to using the private REST CLI if there is an issue with a CmdLet. You could query the job via the UUID. EG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;PS C:\Scripts&amp;gt; .\GetJobCli.ps1 -Cluster 192.168.100.2 -JobID 17b165e7-dea3-11ef-8613-00a098bd46e0 -Credential $credentials
Executing Command: job show -uuid 17b165e7-dea3-11ef-8613-00a098bd46e0 -fields id,name
Enumerated Job "17b165e7-dea3-11ef-8613-00a098bd46e0" on cluster "192.168.100.2" using URL: "https://192.168.100.2/api/private/cli/job?uuid=17b165e7-dea3-11ef-8613-00a098bd46e0&amp;amp;fields=id,name"

id vserver name                   uuid
-- ------- ----                   ----
27 svm_01 SnapMirror Service Job 17b165e7-dea3-11ef-8613-00a098bd46e0&lt;/LI-CODE&gt;&lt;P&gt;Here's the example source code:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Param(
   [Parameter(Mandatory = $True, HelpMessage = "The name or IP Address of the Cluster")]
   [String]$Cluster,
   [Parameter(Mandatory = $True, HelpMessage = "The Job UUID")]
   [String]$JobID,
   [Parameter(Mandatory = $True, HelpMessage = "The Credentials to authenticate to the Cluster")]
   [System.Management.Automation.PSCredential]$Credential
)
#'------------------------------------------------------------------------------
#'Set the certificate policy and TLS version.
#'------------------------------------------------------------------------------
Add-Type @"
   using System.Net;
   using System.Security.Cryptography.X509Certificates;
   public class TrustAllCertsPolicy : ICertificatePolicy {
   public bool CheckValidationResult(
   ServicePoint srvPoint, X509Certificate certificate,
   WebRequest request, int certificateProblem) {
      return true;
   }
}
"@
#[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
#'------------------------------------------------------------------------------
#'Disable SSL Check.
#'------------------------------------------------------------------------------
$sslHandler = @"
public class SSLHandler{
   public static System.Net.Security.RemoteCertificateValidationCallback GetSSLHandler(){
      return new System.Net.Security.RemoteCertificateValidationCallback((sender, certificate, chain, policyErrors) =&amp;gt; { return true; });
   } 
}
"@
Add-Type -TypeDefinition $sslHandler
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = [SSLHandler]::GetSSLHandler()
#'------------------------------------------------------------------------------
#'Enumerate the Certificates.
#'------------------------------------------------------------------------------
[String]$command = "job show -uuid $JobID -fields id,name"
[String]$uri     = "https://$Cluster/api/private/cli/job?uuid=$JobID&amp;amp;fields=id,name"
Write-Host "Executing Command`: $command"
Try{
   $response = Invoke-RestMethod -Method Get -Uri $uri -Credential $Credential -ErrorAction Stop
}Catch{
   Write-Warning -Message $("Failed Enumerating Job ""$JobID"" on Cluster ""$Cluster"" using URL`: ""$uri"". Error " + $_.Exception.Message)
   Exit -1
}
#'------------------------------------------------------------------------------
#'Exit if there were no records returned.
#'------------------------------------------------------------------------------
If($Null -ne $response -And $response.num_records -eq 0){
   Write-Host "There are no entries matching your query"
   Exit 0
}
#'------------------------------------------------------------------------------
#'Display the Certificates.
#'------------------------------------------------------------------------------
If($Null -ne $response -And $response.num_records -ge 1){
   Write-Host "Enumerated Job ""$JobID"" on cluster ""$Cluster"" using URL`: ""$uri"""
}Else{
   Write-Warning -Message "Failed Enumerating Job ""$JobID"" on cluster ""$Cluster"" using URL`: ""$uri"""
   Exit -1
}
$response.records
#'------------------------------------------------------------------------------&lt;/LI-CODE&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 08:46:32 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-ncjob-missing-job-id-and-JobName/m-p/460402#M7056</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2025-04-30T08:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: get-ncjob missing job-id and JobName</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-ncjob-missing-job-id-and-JobName/m-p/460403#M7057</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking at the REST API endpoint "/cluster/jobs" there is no field for "id" or "name" and that would explain why the "Get-NcJob" CmdLet doesn't return a value for these fields. The PSTK will query the ONTAP version and if you are running &amp;gt;= 9.6 the CmdLet's will default to invoking REST API's. Unfortunately the parameter mapping between ZAPI -&amp;gt; REST doesn't always match of is missing functionality. Your options here are to either using the private REST CLI (as provided in the example) or add the "-ZapiCall" to the "Connect-NcController" CmdLet in your script which will force the PSTK to explicitly revert to using ZAPI instead of REST and then the Job ID and Name will be displayed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Matt&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 09:01:41 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-ncjob-missing-job-id-and-JobName/m-p/460403#M7057</guid>
      <dc:creator>mbeattie</dc:creator>
      <dc:date>2025-04-30T09:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: get-ncjob missing job-id and JobName</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-ncjob-missing-job-id-and-JobName/m-p/460404#M7058</link>
      <description>&lt;P&gt;Hi Matt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-ZapiCall was the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THX&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 09:09:02 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/get-ncjob-missing-job-id-and-JobName/m-p/460404#M7058</guid>
      <dc:creator>MiK1</dc:creator>
      <dc:date>2025-04-30T09:09:02Z</dc:date>
    </item>
  </channel>
</rss>

