Forum Discussion
Brandon_Lay_104
Nimbostratus
Jan 13, 2009How do I edit Datagroups via PowerShell
Can someone give me a clue on the method(s) to call for adding strings to datagroups?
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
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