Last active
October 21, 2019 17:24
-
-
Save ChrisLynchHPE/838604061682836466cd64dc2991f420 to your computer and use it in GitHub Desktop.
This script will invoke the IP Pool Collector service that will attempt to reclaim addresses that were not released during resource removal. Example resources that can consume IPv4 Addresses from pools are Logical Enclosures, OS Deployment Servers and Hypervisor Cluster Profiles.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace the -NetworkID parameter with the right Subnet Pool ID to reclaim addresses | |
$subnet = Get-HPOVAddressPoolSubnet -NetworkId 10.41.87.0 | |
ForEach ($range in $subnet.rangeUris) | |
{ | |
$_Uri = $range + '/allocated-fragments?start=0&count=1' | |
$_AllocatedFragments = Send-HPOVRequest -uri $_Uri | |
$_Uri = $range + '/collector' | |
$Body = @{idList = @($_AllocatedFragments.members[0].startAddress)} | |
Send-HPOVRequest -Uri $_Uri -Body $Body -Method PUT | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment