Invoke-NSCustomQuery - Invoke a query against a Citrix NetScaler

This function will invoke a query against a Citrix NetScaler's REST API.

 
 
 
 
 
5 Star
(1)
1,953 times
Add to favorites
Networking
9/16/2015
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Addition to script
    2 Posts | Last post September 16, 2015
    • I noticed that the "Set-TrustAllCertsPolicy" function wasn't contained within the script, so I used one of the answers within this article: http://stackoverflow.com/questions/11696944/powershell-v3-invoke-webrequest-https-error
      to declare the function at the top of my script:
      
      Function Set-TrustAllCertsPolicy{
      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]::CertificatePolicy = New-Object TrustAllCertsPolicy
      }
      
      With this addition, I was able to run the script successfully and just thought I'd let you know.
    • Thanks for the heads up! Added the dependency in.
  • Link Cert to CA
    1 Posts | Last post September 15, 2015
    • First of all, thank you for this.  I have automated a few processes saving myself precious time.
      
      Is there a way to link an existing ssl certificate to an existing certificate authority via Invoke-NSCustomQuery (PowerShell)?  I'm wanting to automate the manual process of right-clicking an ssl, select Link, and choosing an existing CA on the Netscaler.
      
      Please and thank you.