Forum Discussion
dmacika_116140
May 19, 2014Nimbostratus
iControl and Powershell - key import and certificate import
I am attempting to script out importing a SSL crt/key pair into a new F5 running 11.3. I'm using iControl within Powershell. I've successfully used iControl and Powershell for other tasks on this n...
May 20, 2014
Try this one?
if ( (Get-PSSnapin | Where-Object { $_.Name -eq "iControlSnapIn"}) -eq $null ){
Add-PSSnapIn iControlSnapIn
}
Setup Credentials
$user = 'myuser'
$pass = 'mypass'
$SSLDir = ""
$url = "mysite.com"
$success = Initialize-F5.iControl -HostName 10.10.10.10 -Username $user -Password $pass;
$f5 = Get-F5.iControl
$crtfilename = $url + ".crt"
$keyfilename = $url + ".key"
$keyfile = $SSLDir + "\" + $keyfilename
$crtfile = $SSLDir + "\" + $crtfilename
$F5.ManagementPartition.Set_active_partition("Common")
$F5.ManagementKeyCertificate.key_import_from_file(
"MANAGEMENT_MODE_DEFAULT",
(,$url),
(,$keyfile),
$false
)
$F5.ManagementKeyCertificate.certificate_import_from_file(
"MANAGEMENT_MODE_DEFAULT",
(,$url),
(,$certfile),
$false
)
/Patrik
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects