Forum Discussion

Desai_124243's avatar
Desai_124243
Icon for Nimbostratus rankNimbostratus
Apr 18, 2014

How to get specific SSL Profile corrponding with Virtual through Powershelll Icontrol

Hi

When I ran below command, I am getting full output of profiles associated with Virtual. But I can't able to parse the Client SSL from output and getting "iControl.LocalLBVirtualServerVirtualServerProfileAttribute" print.

Do we have any other way? I can get SSL profile name and parse it.

((Get-f5.iControl).LocalLBVirtualServer).get_profile("$virtual")

          profile_type                         profile_context profile_name
          ------------                         --------------- ------------

PROFILE_TYPE_CLIENT_SSL PROFILE_CONTEXT_TYPE_CLIENT clientssl_wildcard.xyz.com_bs... PROFILE_TYPE_HTTP PROFILE_CONTEXT_TYPE_ALL http_xforward_gs_pr PROFILE_TYPE_TCP PROFILE_CONTEXT_TYPE_ALL tcp_exception_bpos_gs_pr

2 Replies

  • Hi!

    If all you want is the Client SSL profile this should work:

    Add-PSSnapIn iControlSnapIn
    
    $Success = Initialize-F5.iControl -Hostname 192.168.161.10 -Credentials (Get-Credential)
    
    Foreach($VSProfiles in ((Get-f5.iControl).LocalLBVirtualServer).get_profile("PajoIIS-443")){
    
        $ClientSSLProfile = $vsprofiles | where { $_.profile_type -eq "PROFILE_TYPE_CLIENT_SSL" }
    
        If($ClientSSLProfile){
            $ClientSSLProfile
        } else {
            "No client SSL profile was found"
        }
    }
    

    /Patrik