Forum Discussion
BenConrad_10265
May 04, 2011Nimbostratus
How to disconnect iControl session?
Hello,
I'm starting to write scripts with the iControl snapin. I understand that I can connect with Initialize-F5.iControl but how do I disconnect my session? Closing out of the PowerShell...
Sep 29, 2011
Hi Ben, the "session" you are creating just sets a local variable in the current iControl.Interfaces object (returned from Get-F5.iControl). Each request to the server is a distinct HTTP connection with separate authentication involved.
This is the first request I've had to clear out the client credentials on the default interfaces object.
If you really want to create a temporary object and be able to clear it out of the existing session, you'll have to bypass the Cmdlets and use the native iControl library that is exposed with the Get-F5.iControl cmdlet. If that's the case then you can just use the New-Object cmdlet instead of Initialize-F5.iControl to create it and then set it to $null when you are done.
$ic = New-Object iControl.Interfaces
$ic.initialize("hostname", "username", "password");
...
$ic = $null
Hope this helps...
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