Skip to content

Instantly share code, notes, and snippets.

View ChrisLynchHPE's full-sized avatar

Chris Lynch ChrisLynchHPE

View GitHub Profile
@ChrisLynchHPE
ChrisLynchHPE / Invoke-IPPoolCollector.ps1
Last active October 21, 2019 17:24
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.
# 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
@ChrisLynchHPE
ChrisLynchHPE / Rename-Server-Profile.ps1
Created April 4, 2018 17:25
Change Server Profile Name
$ProfileToEdit = Get-HPOVServerProfile -Name "My Profile 1" -ErrorAction Stop
$ProfileToEdit.name = "My new name"
# Set-HPOVResource -InputObject $ProfileToEdit
# Or you can use Send-HPOVRequest natively:
# Send-HPOVRequest -Uri $ProfileToEdit.uri -Method PUT -Body $ProfileToEdit | Wait-HPOVTaskComplete