I needed a script to create IPRange Boundaries within SCCM 2012. One of my coworkers suggested that I use a PowerShell CMDLet to get this done for me.
So I opened the CM2012 console and ran the PowerShell Session from the menu in the upper left corner. Then I ran ‘get-help boundary’ to see what was available.
One of the Cmdlets returned was ‘new-cmboundary’. The script reads each line of a csv file in and parses it for the needed information to construct the Boundaries.
To run this script you will need to do three things.
- Run the SCCM 2012 Console as administrator
- Open the PowerShell session from the menu in the upper left corner of the SCCM Console.
- Run this command: Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
CSV File format:
Hyper-V Lab IPRANGE,IPRange,184.108.40.206-220.127.116.11
This script can actually be used to create all of the boundary types in CM2012. To do so, you would need to change the Boundary type and respective value in your CSV file.
Available boundary types are:
- IPSubnet (Example corresponding value: “18.104.22.168/24”)
- ADSite (Example corresponding value: “Default-First-Site-Name”)
- IPv6Prefix (Example corresponding value: “FE80::/64”)
- IPRange (Example Corresponding value: “22.214.171.124-126.96.36.199”)
For more information about the commands used in the script, open PowerShell from within the SCCM console and type the following commands:
- Get-Help Import-CSV
- Get-Help New-CMBoundary