Remove IP Addresses from a Managed Pool in SCVMM 2012 SP1 using PowerShell

This is a quick entry so that I can note down a small snippet of code for next time when I run into this one. Recently I have worked with Microsoft System Centre Virtual Machine Manager (SCVMM) 2012 SP1 and found that after creating a managed IP Address Pool that when needing to remove the Pool I had to first remove the allocated IP’s that VMM had linked to hosts under management. Rather than manually removing each one I was able to pipe the command-line to do a bulk removal of the entire subnet.

Here is the example snippet that does this:

PS C:\Windows\system32> $IPPool = Get-SCStaticIPAddressPool -IPv4 -Subnet ""
PS C:\Windows\system32> $IP = Get-SCIPAddress -StaticIPAddressPool $IPPool
PS C:\Windows\system32> $IP | Revoke-SCIPAddress


Rating 3.00 out of 5

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
%d bloggers like this: