Forum Discussion

Jeffrey_Silver1's avatar
Jeffrey_Silver1
Icon for Nimbostratus rankNimbostratus
Sep 27, 2013

Management.KeyCertificate Powershell command

Can anyone point me to a powershell example that uses the certificate_request_export_to_file method?

 

I am unable to get the syntax correct.

 

2 Replies

  • Ok, let me try another way. I am trying to export ssl certificates from one LTM to another using powershell and iControl. The better question is am I going about this in the correct manner.

     

  • With the assitance of Joe Pruitt, I have been able to figure out what I was having issues with. The goal is to get the clientSSL certs from one F5 into another F5 without doing a full configSync type process. The following code snipped in POWERSHELL gets the .crt and .key content that I am planning on importing into the other LTM using the cerfiticate_import_from_pem and key_import_from_pem methods.

     

    if ( Initialize-F5.iControl -Hostname $name -Username xxxx -Password xxxx ) {
      $g_Certs = (Get-F5.iControl).ManagementKeyCertificate
      $ocrt = ($g_Certs).certificate_export_to_pem('MANAGEMENT_MODE_DEFAULT',$cname)
      $okey = ($g_Certs).key_export_to_pem('MANAGEMENT_MODE_DEFAULT',$cname)
    } else {
      write-host "Critical Error Has Occurred. Cannot Initialize secondary iControl" 
      return $false
    }