Forum Discussion

AngryCat_52750's avatar
AngryCat_52750
Icon for Nimbostratus rankNimbostratus
Jan 29, 2016

automate session delete

i have a task to delete specific sesssions every night. is there anyway i can automate this. i looked in the powershell module but there were no delete modules.

 

i am looking to run the following command every night..

 

-> delete sys connection cs-server-addr 1.1.1.1 cs-client-addr 1.1.1.100

 

any ideas??

 

3 Replies

  • The powershell module has some built-ins, but it has access to the API via the Get-F5.iControl object. You should be able to use a combination of get_all_active_connections_v2 and delete_active_connection to achieve your result.

    Here's a quick sample on getting the connection list:

    (Get-F5.iControl).SystemConnections.get_all_active_connections()
    
  • How to write in Powershell? is it like below

    $Clientside_ClientipPortDef = new-object -typename iControl.CommonIPPortDefinition
    $Clientside_ClientipPortDef.address = "10.118.219.205";
    $Clientside_ClientipPortDef.port = 4500;
    
    $Serverside_ServeripPortDef = new-object -typename iControl.CommonIPPortDefinition
    $Serverside_ServeripPortDef.address = "10.118.219.198";
    $Serverside_ServeripPortDef.port = 4500;
    
    $Clientside_ServeripPortDef = new-object -typename iControl.CommonIPPortDefinition
    $Clientside_ServeripPortDef.address = "10.118.219.220";
    $Clientside_ServeripPortDef.port = 4500;
    
    
    (Get-F5.iControl).SystemConnections.delete_active_connection($Clientside_ClientipPortDef,$Clientside_ServeripPortDef,$Serverside_ServeripPortDef)