Quantcast



Docs


Blogs


Forums


Samples


Media


Labs


Resources

 




DevCentral > Weblogs > Joe Pruitt - A Software Architect's take on Network Security
 iControl Cmdlets
posted on Wednesday, June 20, 2007 4:58 PM

When we shipped DC4, we started looking at Windows PowerShell and how we could build some integration points with our products. The first pass was a set of PowerShell script files that we introduced in the PowerShell Labs section of DevCentral. No soon after we posted them, the requests started pouring in on when we would provide some native PowerShell CmdLets in addition to the function scripts.

Well, I spent a little bit of time working some out and whipped out a good first rough draft. I've been holding on to these for a while now but figured they would do better out in the wild then trapped in a folder on my laptop.

So, last night I posted an installer for the first release of the iControl CmdLets for PowerShell.  I also ran some screen captures on how to install and use the CmdLets but ended up with some technical difficulties with the screen capture software - Camtasia is now on order B-).  So, once I can get a good capture, be on the lookout.  In the mean time, here's a step by step on getting up and running with the new bits.

  1. Download and install PowerShell from Microsoft
  2. Go to the PowerShell Labs page on DevCentral and select the "Download Now" link.  This will download the Cmdlet installer.
  3. Run the iControlSnapInSetup.msi installer.  This will install the SnapIn into the c:\program files\F5 Networks\iControlSnapIn directory.
  4. Start PowerShell from the Windows Start menu.
  5. Cd to c:\program files\F5 Networks\iControlSnapIn directory
  6. Dot Source the setup script (only once after the install)
    PS > . .\setupSnapIn.ps1)
  7. Load the SnapIn into the Runtime
    PS > Add-PSSnapIn iControlSnapIn
  8. Initialize the iControl connection with the Initialize-F5.iControl CmdLet
    PS > Initialize-F5.iControl -Hostname bigip_address -Credentials (Get-Credential)
  9. Run the Get-F5.iControlCommands CmdLet to list out all the available Cmdlets.
    PS > Get-F5.iControlCommands
  10. Try out some of the CmdLets
    PS > Get-F5.LTMPool

That should be about it.  Hopefully I'll automate some of the setup procedures into the installer (if anyone knows how to get the Installer Project in VS.Net to include a shortcut to a non-project item, please let me know B-).

Enjoy!

-Joe

 




Email This
  del.icio.us
      

Feedback


6/21/2007 9:16 AM
Gravatar I'm getting an error on step 6:

PS C:\Program Files\F5 Networks\iControlSnapIn> ..\setupSnapIn.ps1
The term '..\setupSnapIn.ps1' is not recognized as a cmdlet, function, operable
program, or script file. Verify the term and try again.
At line:1 char:18
+ ..\setupSnapIn.ps1 <<<<
Jason Rahm

6/21/2007 9:30 AM
Gravatar There's a space between the dots...

.<space>.\setupSnapIn.ps1

-Joe
Joe Pruitt

6/21/2007 10:25 AM
Gravatar Powershell by default sets the execution policy to restricted, which prevents the execution of saved scripts. I changed the policy to RemoteSigned by creating this key in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell

Create new key:
Name: ExecutionPolicy
Type: REG_SZ
Data: RemoteSigned

I understand this can also be set at the command line within the powershell.
Jason Rahm

6/21/2007 10:30 AM
Gravatar OK, all is working. Very cool stuff...I love new toys. Excellect work, Joe.
Jason Rahm

7/9/2007 4:16 PM
Gravatar Great to hear it! Let me know if you find your self wishing for more features and I'll add them to the list.

-Joe
Joe Pruitt

4/15/2008 12:52 PM
Gravatar Where's the cmdlet? The download in step 2 doesn't include any installer utility/msi files...
scott

4/17/2008 2:19 PM
Gravatar I'm actually having a tough time getting this working. Everything is installed and registered:

Name : iControlSnapIn
PSVersion : 1.0
Description : iControl Snap-in for F5 Device Management

But I keep getting errors:

PS C:\Program Files\F5 Networks\iControlSnapIn> Initialize-iControl
The term 'Initialize-iControl' is not recognized as a cmdlet, function, ope
e program, or script file. Verify the term and try again.
At line:1 char:19
+ Initialize-iControl <<<<
Iain

4/17/2008 2:39 PM
Gravatar The cmdlet's have changed since I put this post up. All of the nouns in the cmdlets are prefixed with "F5.". Call the cmdlet Get-F5.iControlCommands and it will list all the iControl Cmdlets.

I'll work on getting this post updated. Sorry for the inconvenience.

-Joe
Joe Pruitt

4/17/2008 4:19 PM
Gravatar Thanks for the update, and I appreciate that you guys went to the trouble (and redid your work) to help avoid name collision in powershell.

Now I just need to figure out how to do get_default_pool . . .

Great stuff!
Iain
 Leave Feedback
Title  
Name  
Email
Url
Comments   
Please add 8 and 8 and type the answer here: