ConfigMgr Script: IP Subnet Boundary Management using CSV

Attached to this post is a PowerShell script that will take a CSV file and manage your boundaries. The script will create new boundaries and delete old ones, all based on a CSV file. This is really nice if you can pull an extract from your network that lists all of the IP Subnets.


First, rename the downloaded file with a .ps1 extension.

The script requires at a minimum ConfigMgr 2012 SP2 or R2 SP1 (Current Branch recommended) and must be executed from a  device that has the ConfigMgr console installed. Change the variables in line 2, 5, 8, and 11 to fit your environment. The variable in line 8 asks for a log file location. This script will log all successes and failures to this file.

Line 11 asks for the network extract. At a minimum, this file should contain three columns. One should be whether this is an add or delete, two should be IP subnet, and the third should be a description. Details are provided later in this post about the formatting for these columns.

Required Script Changes

Since there isn’t a common format, you may need to change a few things. Pay attention to these changes.

Lines 20-22:


These are only needed if your CSV file includes the bit length, i.e. the address is formatted like instead of just Because ConfigMgr does not need this information (and the command actually errors if it’s included), these lines remove the bit length and reinsert it into the networks variable. If you use this section of the script, be sure that “name” is the column title in your CSV. If it’s not, change the three mentions of “name” in line 22 to reflect the column name that stores the IP information.

Lines 41 and 64:


First, if the column name is not “TYPE”, then change both instances of the type. This is the column that specifies whether this is a new subnet, or a subnet to be removed. Next, if the values aren’t “Add” and “Delete”, change those values accordingly as well.

Lines 45-46 and 68-69:


These are more column heading changes. Be sure that the IP Subnet is the “NAME” column, or change lines 45 and 68 accordingly. Also, make sure the description is in the “C_NAME” column, or change the lines 46 and 69 accordingly.


All content provided on this blog is for information purposes only. Windows Management Experts, Inc makes no representation as to accuracy or completeness of any information on this site. Windows Management Experts, Inc will not be liable for any errors or omission in this information nor for the availability of this information. It is highly recommended that you consult one of our technical consultants, should you need any further assistance.

[download id=”5460″]



Contact Us

On Key

More Posts

Mastering Azure AD Connect - A Comprehensive Guide by WME
Active Directory

Mastering Azure AD Connect – A Comprehensive Guide

Modern businesses are fast moving toward cloud-based infrastructure. In fact, cloud-based business is not just a trend anymore but a strategic necessity. Microsoft’s Azure Active Directory (Azure AD) has become a frontrunner in this domain. It

Read More »
Security Best Practices in SharePoint
Office 365

Security Best Practices in SharePoint

Microsoft SharePoint is an online collaboration platform that integrates with Microsoft Office. You can use it to store, organize, share, and access information online. SharePoint enables collaboration and content management and ultimately allows your teams to

Read More »
The Ultimate Guide to Microsoft Intune - Article by WME
Active Directory

The Ultimate Guide to Microsoft Intune

The corporate world is evolving fast. And with that, mobile devices are spreading everywhere. As we venture into the year 2024, they have already claimed a substantial 55% share of the total corporate device ecosystem. You

Read More »
Protecting Microsoft 365 from on-Premises Attacks
Cloud Security

How to Protect Microsoft 365 from On-Premises Attacks?

Microsoft 365 is diverse enough to enrich the capabilities of many types of private businesses. It complements users, applications, networks, devices, and whatnot. However, Microsoft 365 cybersecurity is often compromised and there are countless ways that

Read More »
Be assured of everything

Get WME Services

Stay ahead of the competition with our Professional IT offerings.