Forum Discussion
Disconnect iControl if user is idle?
There is no "persistent" connection with iControl. When you call "Initialize" with credentials, it tests a connection with those creds and, if that succeeds, caches them locally in the internal iControl.Interfaces object (returned from the Get-F5.iControl cmdlet). All calls to the BIG-IP are separate HTTPS connections with independent authorization so there really isn't anything to "disconnect".
If you want to "uninitialize" the Interfaces object, you can do something like this
(Get-F5.iControl).ConnectionInfo.creds.UserName = ""
And then subsequent calls will fail with a 401 Authorization required error until you call Initialize-F5.iControl again.
As for a timed input prompt, Read-Host doesn't support that. Do a search for "powershell read-host timeout" and there are some solutions out there for rolling your own.
-Joe
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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