Forum Discussion
Jan 14, 2009
You are close. The LocalLBClassAddressClass's members member is of type LocalLB.Class.AddressEntry. You'll need to change your string literal of (10.100.100.1) to an appropriate structure. This should work:
$Class = (Get-F5.iControl).LocalLBClass
$AddressClass = New-Object -TypeName iControl.LocalLBClassAddressClass
$AddressClass.name = "MyAddressGroup"
Allocate a AddressEntry structure with a
netmask of 255.255.255.255 for a Host address.
$AddrEntry = New-Object -TypeName iControl.LocalLBClassAddressEntry
$AddrEntry.address = "10.100.100.1"
$AddrEntry.netmask = "255.255.255.255"
Assign the entry to the members member.
$AddressClass.members = (,$AddrEntry)
add the address class members
$Class.add_address_class_member( (,$AddressClass) )
Hope this helps!
-Joe