Last active
March 7, 2017 18:12
-
-
Save ryancbutler/011ceab59397abd6feb977776936aa93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls | |
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} | |
$username = "nsroot" | |
$password = "nsroot" | |
$nsip = "https://192.168.1.50" | |
$body = ConvertTo-JSON @{ | |
"login"=@{ | |
"username"="$username"; | |
"password"="$password" | |
} | |
} | |
Invoke-RestMethod -uri "$nsip/nitro/v1/config/login" -body $body -SessionVariable NSSession -Headers @{"Content-Type"="application/vnd.com.citrix.netscaler.login+json"} -Method POST | |
$ssl = Invoke-RestMethod -uri "$nsip/nitro/v1/config/sslcertkey" -WebSession $NSSession -Headers @{"Content-Type"="application/json"} -Method GET | |
$ssl.sslcertkey|select certkey,cert,key|ft -AutoSize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment