{"id":220,"date":"2018-08-30T04:30:14","date_gmt":"2018-08-30T04:30:14","guid":{"rendered":"http:\/\/michaelschultz.net\/tech\/?p=220"},"modified":"2018-11-26T19:44:02","modified_gmt":"2018-11-26T19:44:02","slug":"using-powershell-to-fake-converting-configmgr-ipsubnet-to-iprange-boundaries","status":"publish","type":"post","link":"https:\/\/michaelschultz.net\/tech\/using-powershell-to-fake-converting-configmgr-ipsubnet-to-iprange-boundaries\/","title":{"rendered":"Using PowerShell to fake converting ConfigMgr IPSubnet to IPRange boundaries"},"content":{"rendered":"<p>Over the years that I have done work ConfigMgr, there was a back and forth on what type of boundaries to use between IPRange and IPSubnet. I have worked in places that were one or the other as well as mixed. Normally, what was used was determined by the suggestion of a Microsoft PFE. Now, I want to convert my IPSubnet boundaries to IPRange boundaries.<!--more--><\/p>\n<p>Personally, I do not like IPSubnet boundaries in ConfigMgr because the subnet mask information is not stored in the database. This means I can tell what the first IP address covered in the boundary is but I do not know what the last IP will be.<\/p>\n<p>In most cased for my environment, the IPSubnet will just cover a single full class C range. For the range of 10.10.10.0-10.10.10.255, it would have Network of 10.10.10.0, Subnet mask of 255.255.255.0, and have a subnet ID of 10.10.10.0 in ConfigMgr.<\/p>\n<p>Now I have seen a few cases in other environments where the range is 10.10.10.0-10.10.11.255. This would have Network of 10.10.10.0, Subnet mask of 255.255.254.0, and end up with a subnet ID of 10.10.10.0 in ConfigMgr. This is the same SubnetID even though the subnet mask is different.<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-223\" src=\"https:\/\/i0.wp.com\/michaelschultz.net\/tech\/wp-content\/uploads\/2018\/08\/subnetid.jpg?resize=840%2C314\" alt=\"\" width=\"840\" height=\"314\" srcset=\"https:\/\/i0.wp.com\/michaelschultz.net\/tech\/wp-content\/uploads\/2018\/08\/subnetid.jpg?w=1090&amp;ssl=1 1090w, https:\/\/i0.wp.com\/michaelschultz.net\/tech\/wp-content\/uploads\/2018\/08\/subnetid.jpg?resize=300%2C112&amp;ssl=1 300w, https:\/\/i0.wp.com\/michaelschultz.net\/tech\/wp-content\/uploads\/2018\/08\/subnetid.jpg?resize=768%2C287&amp;ssl=1 768w, https:\/\/i0.wp.com\/michaelschultz.net\/tech\/wp-content\/uploads\/2018\/08\/subnetid.jpg?resize=1024%2C383&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<p>In my environment, we have recently set the standard to use IP ranges only, but what to do with the existing SubnetIP based boundaries? We need to switch them over to ranges, but that is not a fun thing to do manually. Luckily, there is PowerShell to the rescue.<\/p>\n<p>Unfortunately, I quickly learned that SET-CMBOUNDARY is great for changing the name of the boundary but you cannot change the type and give it a new value. I have to create new boundaries.<\/p>\n<p>Here is what I needed to do:<br \/>\n1) Figure out the IP range from the Subnet ID (Only worrying about X.X.X.0 SubnetIDs and assuming the subnet masks are all 255.255.255.0)<br \/>\n2) Create the new range based boundary with the same name as the old subnetID boundary<br \/>\n3) Add the new boundaries to same boundary groups as the old ones<br \/>\n4) Remove the old subnetID boundary, if desired<br \/>\n5) Repeat over 1000 times<\/p>\n<p>My solution is ugly and probably not the greatest because it loops through a CSV file and each boundary has multiple lines because each boundary is a member of multiple boundary groups and I need better SQL skills. This leads to many errors as it tries to create the boundary after creating it and tries to delete the old boundary after deleting it.<\/p>\n<p>The first step was to get all the info I needed and SQL had it all.<\/p>\n<p>Using the following query, I got the name of the boundaries, their ID, took the subnet value and converted it to a range, and got the boundary groups IDs of the groups the boundaries are part of.<\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-222\" src=\"https:\/\/i0.wp.com\/michaelschultz.net\/tech\/wp-content\/uploads\/2018\/08\/output.jpg?resize=458%2C168\" alt=\"\" width=\"458\" height=\"168\" srcset=\"https:\/\/i0.wp.com\/michaelschultz.net\/tech\/wp-content\/uploads\/2018\/08\/output.jpg?w=458&amp;ssl=1 458w, https:\/\/i0.wp.com\/michaelschultz.net\/tech\/wp-content\/uploads\/2018\/08\/output.jpg?resize=300%2C110&amp;ssl=1 300w\" sizes=\"auto, (max-width: 458px) 85vw, 458px\" \/><\/p>\n<div class=\"codecolorer-container sql default\" style=\"overflow:auto;white-space:nowrap;width:500px;\"><div class=\"sql codecolorer\"><span class=\"kw1\">SELECT<\/span><br \/>\nvSMS_Boundary<span class=\"sy0\">.<\/span>DisplayName<span class=\"sy0\">,<\/span> vSMS_Boundary<span class=\"sy0\">.<\/span>BoundaryID <span class=\"kw1\">AS<\/span> id<span class=\"sy0\">,<\/span><br \/>\nSTUFF<span class=\"br0\">&#40;<\/span>vSMS_Boundary<span class=\"sy0\">.<\/span>value<span class=\"sy0\">,<\/span> LEN<span class=\"br0\">&#40;<\/span>vSMS_Boundary<span class=\"sy0\">.<\/span>value<span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span> <span class=\"nu0\">1<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">'1'<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">+<\/span> <span class=\"st0\">'-'<\/span> <span class=\"sy0\">+<\/span> STUFF<span class=\"br0\">&#40;<\/span>vSMS_Boundary<span class=\"sy0\">.<\/span>value<span class=\"sy0\">,<\/span> LEN<span class=\"br0\">&#40;<\/span>vSMS_Boundary<span class=\"sy0\">.<\/span>value<span class=\"br0\">&#41;<\/span><span class=\"sy0\">,<\/span> <span class=\"nu0\">1<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">'254'<\/span><span class=\"br0\">&#41;<\/span> <span class=\"kw1\">AS<\/span> range<span class=\"sy0\">,<\/span><br \/>\nvSMS_BoundaryGroup<span class=\"sy0\">.<\/span>GroupID <span class=\"kw1\">AS<\/span> bgid<br \/>\n<span class=\"kw1\">FROM<\/span> vSMS_Boundary <span class=\"kw1\">INNER<\/span> <span class=\"kw1\">JOIN<\/span><br \/>\nvSMS_BoundaryGroupMembers <span class=\"kw1\">ON<\/span> vSMS_Boundary<span class=\"sy0\">.<\/span>BoundaryID <span class=\"sy0\">=<\/span> vSMS_BoundaryGroupMembers<span class=\"sy0\">.<\/span>BoundaryID <span class=\"kw1\">INNER<\/span> <span class=\"kw1\">JOIN<\/span><br \/>\nvSMS_BoundaryGroup <span class=\"kw1\">ON<\/span> vSMS_BoundaryGroupMembers<span class=\"sy0\">.<\/span>GroupID <span class=\"sy0\">=<\/span> vSMS_BoundaryGroup<span class=\"sy0\">.<\/span>GroupID<br \/>\n<span class=\"kw1\">WHERE<\/span> vSMS_Boundary<span class=\"sy0\">.<\/span>BoundaryType <span class=\"sy0\">=<\/span> <span class=\"st0\">'0'<\/span> <span class=\"kw1\">AND<\/span> vSMS_Boundary<span class=\"sy0\">.<\/span>Value <span class=\"kw1\">LIKE<\/span> <span class=\"st0\">'%.0'<\/span><\/div><\/div>\n<p>I took the output the copied it with headers into Excel to create a CSV file. This will be the input for the script. As mentioned before, these ranges are created with the assumption that are full class C ranges with 255.255.255.0 or \/24 subnet. If you have subnets that are \/22 or \/13, for example, the SQL is still a great start and you can just edit the third octet of second half of the range within the CSV file to create a properly sized IPRange boundary.<\/p>\n<p>The input CSV file can be manually created as well. The column headers are displayname, id, range, and bgid.<\/p>\n<p>Displayname \u2013 The name of the boundary<br \/>\nId \u2013 BoundaryID of the out IPSubnet boundaryRange \u2013 IP range for the boundary<br \/>\nBgid \u2013 Boundary Group ID to add boundary. Each boundary group add does<\/p>\n<p>require a separate line in the CSV<\/p>\n<p>I then passed the information in the CVS through my PowerShell script. The script created the IPRange boundaries, associated boundary groups to the boundary, and then deleted the old IPSubnet boundary.<\/p>\n<p>The syntax is:<\/p>\n<p>Switch-IPSubnet-to-IPRange-Boundaries.ps1 -inputfile file.csv -sc sitecode: &lt;-del y&gt;<\/p>\n<p>The \u2013del y switch is not mandatory and toggles the automatic deletion of the IPSubnet boundaries. Without the switch, they have to be deleted afterwards.<\/p>\n<p>The script and SQL can be found GitHub at https:\/\/github.com\/NecroMonkey\/vault\/tree\/master\/ConfigMgr-Scripts<\/p>\n<div class=\"codecolorer-container powershell default\" style=\"overflow:auto;white-space:nowrap;width:500px;\"><div class=\"powershell codecolorer\"><span class=\"sy0\">&amp;<\/span>lt;<span class=\"co1\">#<\/span><br \/>\n<br \/>\n.SYNOPSIS<br \/>\nThe script takes an input CSV file of IPSUbnet boundaries and loops through it to create new IPRange boundaries<br \/>\n<br \/>\n.SYNTAX<br \/>\nSwitch<span class=\"sy0\">-<\/span>IPSubnet<span class=\"sy0\">-<\/span>to<span class=\"sy0\">-<\/span>IPRange<span class=\"sy0\">-<\/span>Boundaries.ps1 <span class=\"sy0\">-<\/span>inputfile file.csv <span class=\"sy0\">-<\/span><span class=\"kw2\">sc<\/span> sitecode: <span class=\"sy0\">&amp;<\/span>lt;<span class=\"sy0\">-<\/span><span class=\"kw2\">del<\/span> y<span class=\"sy0\">&amp;<\/span>gt;<br \/>\n<br \/>\n.DESCRIPTION<br \/>\nThe script takes an input CSV file and loops through it to create new IP range based ConfigMgr boundaries off IP subnt boundaries <span class=\"kw3\">in<\/span> the file<span class=\"sy0\">,<\/span> add it to desired boundary groups<span class=\"sy0\">,<\/span> and delete the old IPSubnet boundary.<br \/>\n<br \/>\n.PARAMETER DisplayName<br \/>\nName to be given to the new boundary created<br \/>\n<br \/>\n.PARAMETER id<br \/>\nBoundary ID of the IPSubnet boundary being replaced by the new IPRange boundary<br \/>\n<br \/>\n.PARAMETER range<br \/>\nIP Range to be used <span class=\"kw3\">in<\/span> creating the IPRange boundary. x.x.x.x<span class=\"sy0\">-<\/span>x.x.x.x format<br \/>\n<br \/>\n.PARAMETER bgid<br \/>\nBoundary <span class=\"kw2\">Group<\/span> ID that the new boundary will be added<br \/>\n<br \/>\n.PARAMETER <span class=\"kw2\">del<\/span><br \/>\nOptional parameter to automatically remove the old IPSubnet boundary. Suggest not using and verify new boundarie and manually delete old. Only accepted pararmeter is y<br \/>\n<br \/>\n.PARAMETER <span class=\"kw2\">sc<\/span><br \/>\nConfigMgr site code. FOrmat is site code followed by :<br \/>\n<br \/>\n.PARAMETER InputFile<br \/>\nPath and name of input CSV file<br \/>\n<br \/>\n.INPUTS<br \/>\nCSV file with the following column header names: displayname<span class=\"sy0\">,<\/span> id<span class=\"sy0\">,<\/span> range<span class=\"sy0\">,<\/span> and bgid. This is the input <span class=\"kw3\">for<\/span> the matching parameters. Each boundary <span class=\"kw2\">group<\/span> add does require a separate line<br \/>\n<br \/>\n.NOTES<br \/>\nFileName: Switch<span class=\"sy0\">-<\/span>IPSubnet<span class=\"sy0\">-<\/span>to<span class=\"sy0\">-<\/span>IPRange<span class=\"sy0\">-<\/span>Boundaries.ps1<br \/>\nAuthor: Michael Schultz<br \/>\nContact: mschultz<span class=\"sy0\">@<\/span>necro<span class=\"sy0\">-<\/span>monkey.com<br \/>\nCreated: <span class=\"nu0\">20180825<\/span><br \/>\nModified:<br \/>\nVersion: 1.0.0<br \/>\n<br \/>\n.EXAMPLE<br \/>\n.\\recreateranges.ps1 <span class=\"sy0\">-<\/span>InputFile .\\InputFile.csv <span class=\"sy0\">-<\/span><span class=\"kw2\">del<\/span> y <span class=\"sy0\">-<\/span><span class=\"kw2\">sc<\/span> sms:<br \/>\n<br \/>\n<span class=\"co1\">#&amp;gt;<\/span><br \/>\n<br \/>\n<span class=\"co1\">#-----Parameters-----<\/span><br \/>\n<br \/>\n<span class=\"kw3\">param<\/span><span class=\"br0\">&#40;<\/span><br \/>\n<span class=\"br0\">&#91;<\/span>Parameter<span class=\"br0\">&#40;<\/span>ParameterSetName<span class=\"sy0\">=<\/span><span class=\"nu0\">1<\/span><span class=\"sy0\">,<\/span>Mandatory<span class=\"sy0\">=<\/span><span class=\"re0\">$true<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#93;<\/span><br \/>\n<span class=\"br0\">&#91;<\/span><span class=\"re3\">string<\/span><span class=\"br0\">&#93;<\/span><span class=\"re0\">$DisplayName<\/span><span class=\"sy0\">,<\/span><br \/>\n<span class=\"br0\">&#91;<\/span>Parameter<span class=\"br0\">&#40;<\/span>ParameterSetName<span class=\"sy0\">=<\/span><span class=\"nu0\">1<\/span><span class=\"sy0\">,<\/span>Mandatory<span class=\"sy0\">=<\/span><span class=\"re0\">$true<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#93;<\/span><br \/>\n<span class=\"br0\">&#91;<\/span><span class=\"re3\">string<\/span><span class=\"br0\">&#93;<\/span><span class=\"re0\">$range<\/span><span class=\"sy0\">,<\/span><br \/>\n<span class=\"br0\">&#91;<\/span>Parameter<span class=\"br0\">&#40;<\/span>ParameterSetName<span class=\"sy0\">=<\/span><span class=\"nu0\">1<\/span><span class=\"sy0\">,<\/span>Mandatory<span class=\"sy0\">=<\/span><span class=\"re0\">$true<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#93;<\/span><br \/>\n<span class=\"br0\">&#91;<\/span><span class=\"re3\">string<\/span><span class=\"br0\">&#93;<\/span><span class=\"re0\">$bgid<\/span><span class=\"sy0\">,<\/span><br \/>\n<span class=\"br0\">&#91;<\/span>Parameter<span class=\"br0\">&#40;<\/span>ParameterSetName<span class=\"sy0\">=<\/span><span class=\"nu0\">1<\/span><span class=\"sy0\">,<\/span>Mandatory<span class=\"sy0\">=<\/span><span class=\"re0\">$true<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#93;<\/span><br \/>\n<span class=\"br0\">&#91;<\/span><span class=\"re3\">string<\/span><span class=\"br0\">&#93;<\/span><span class=\"re0\">$id<\/span><span class=\"sy0\">,<\/span><br \/>\n<span class=\"br0\">&#91;<\/span>Parameter<span class=\"br0\">&#40;<\/span>ParameterSetName<span class=\"sy0\">=<\/span><span class=\"nu0\">2<\/span><span class=\"sy0\">,<\/span>Mandatory<span class=\"sy0\">=<\/span><span class=\"re0\">$false<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#93;<\/span><br \/>\n<span class=\"br0\">&#91;<\/span><span class=\"re3\">string<\/span><span class=\"br0\">&#93;<\/span><span class=\"re0\">$del<\/span><span class=\"sy0\">,<\/span><br \/>\n<span class=\"br0\">&#91;<\/span>Parameter<span class=\"br0\">&#40;<\/span>ParameterSetName<span class=\"sy0\">=<\/span><span class=\"nu0\">2<\/span><span class=\"sy0\">,<\/span>Mandatory<span class=\"sy0\">=<\/span><span class=\"re0\">$true<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#93;<\/span><br \/>\n<span class=\"br0\">&#91;<\/span><span class=\"re3\">string<\/span><span class=\"br0\">&#93;<\/span><span class=\"re0\">$sc<\/span><span class=\"sy0\">,<\/span><br \/>\n<span class=\"br0\">&#91;<\/span>Parameter<span class=\"br0\">&#40;<\/span>ParameterSetName<span class=\"sy0\">=<\/span><span class=\"nu0\">2<\/span><span class=\"sy0\">,<\/span>Mandatory<span class=\"sy0\">=<\/span><span class=\"re0\">$true<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#93;<\/span><br \/>\n<span class=\"br0\">&#91;<\/span><span class=\"re3\">string<\/span><span class=\"br0\">&#93;<\/span><span class=\"re0\">$InputFile<\/span><br \/>\n<span class=\"br0\">&#41;<\/span><br \/>\n<br \/>\n<span class=\"co1\">#-----Initializations and Module Imports-----<\/span><br \/>\n<br \/>\n<span class=\"co1\">#Get ConfigMgr Console Install Path to locate PS Module.<\/span><br \/>\n<br \/>\n<span class=\"kw3\">If<\/span> <span class=\"br0\">&#40;<\/span><span class=\"kw1\">Test-Path<\/span> <span class=\"st0\">&quot;C:\\Program Files\\Microsoft Configuration Manager\\AdminConsole\\bin\\ConfigurationManager.psd1&quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\nImport<span class=\"sy0\">-<\/span>Module <span class=\"st0\">&quot;C:\\Program Files\\Microsoft Configuration Manager\\AdminConsole\\bin\\ConfigurationManager.psd1&quot;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"kw3\">elseIf<\/span> <span class=\"br0\">&#40;<\/span><span class=\"kw1\">Test-Path<\/span> <span class=\"st0\">&quot;C:\\Program Files (x86)\\Microsoft Configuration Manager\\AdminConsole\\bin\\ConfigurationManager.psd1&quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\nImport<span class=\"sy0\">-<\/span>Module <span class=\"st0\">&quot;C:\\Program Files (x86)\\Microsoft Configuration Manager\\AdminConsole\\bin\\ConfigurationManager.psd1&quot;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"kw3\">elseif<\/span> <span class=\"br0\">&#40;<\/span><span class=\"kw1\">test-path<\/span> <span class=\"st0\">&quot;d:\\Program Files\\Microsoft Configuration Manager\\AdminConsole\\bin\\ConfigurationManager.psd1&quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\nImport<span class=\"sy0\">-<\/span>Module <span class=\"st0\">&quot;d:\\Program Files\\Microsoft Configuration Manager\\AdminConsole\\bin\\ConfigurationManager.psd1&quot;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"kw3\">elseIf<\/span> <span class=\"br0\">&#40;<\/span><span class=\"kw1\">Test-Path<\/span> <span class=\"st0\">&quot;d:\\Program Files (x86)\\Microsoft Configuration Manager\\AdminConsole\\bin\\ConfigurationManager.psd1&quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\nImport<span class=\"sy0\">-<\/span>Module <span class=\"st0\">&quot;d:\\Program Files (x86)\\Microsoft Configuration Manager\\AdminConsole\\bin\\ConfigurationManager.psd1&quot;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"kw3\">Else<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n<span class=\"kw1\">Write-output<\/span> <span class=\"st0\">&quot;Can't Find your ConfigMgr Module&quot;<\/span><br \/>\nexit<br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n<span class=\"co1\">#-----Variables-----<\/span><br \/>\n<br \/>\n<span class=\"re0\">$List<\/span> <span class=\"sy0\">=<\/span> <span class=\"kw1\">Import-Csv<\/span> <span class=\"kw5\">-Path<\/span> <span class=\"re0\">$InputFile<\/span><br \/>\n<br \/>\n<span class=\"co1\">#-----Execution-----<\/span><br \/>\n<br \/>\n<span class=\"co1\">#Change to ConfigMgr PSDrive<\/span><br \/>\n<span class=\"kw1\">Set-Location<\/span> <span class=\"re0\">$sc<\/span><br \/>\n<br \/>\n<span class=\"co1\">#Create IPRange boundaries<\/span><br \/>\n<span class=\"kw3\">Foreach<\/span> <span class=\"br0\">&#40;<\/span><span class=\"re0\">$item<\/span> <span class=\"kw3\">in<\/span> <span class=\"re0\">$List<\/span><span class=\"br0\">&#41;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\nNew<span class=\"sy0\">-<\/span>CMBoundary <span class=\"kw5\">-DisplayName<\/span> <span class=\"re0\">$item<\/span>.DisplayName <span class=\"sy0\">-<\/span>BoundaryType IPRange <span class=\"kw5\">-Value<\/span> <span class=\"re0\">$item<\/span>.range<br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n<span class=\"co1\">#Add new boundary to boundary groups<\/span><br \/>\n<span class=\"kw3\">Foreach<\/span> <span class=\"br0\">&#40;<\/span><span class=\"re0\">$item<\/span> <span class=\"kw3\">in<\/span> <span class=\"re0\">$List<\/span><span class=\"br0\">&#41;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\nAdd<span class=\"sy0\">-<\/span>CMBoundaryToGroup <span class=\"sy0\">-<\/span>BoundaryGroupID <span class=\"re0\">$item<\/span>.bgid <span class=\"sy0\">-<\/span>BoundaryName <span class=\"re0\">$item<\/span>.Displayname<br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n<span class=\"co1\">#Delete old IPSubnet boundary if desired<\/span><br \/>\n<span class=\"kw3\">if<\/span> <span class=\"br0\">&#40;<\/span><span class=\"re0\">$del<\/span> <span class=\"kw4\">-eq<\/span> <span class=\"st0\">'y'<\/span><span class=\"br0\">&#41;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\n<span class=\"kw3\">Foreach<\/span> <span class=\"br0\">&#40;<\/span><span class=\"re0\">$item<\/span> <span class=\"kw3\">in<\/span> <span class=\"re0\">$List<\/span><span class=\"br0\">&#41;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\nRemove<span class=\"sy0\">-<\/span>CMBoundary <span class=\"kw5\">-Id<\/span> <span class=\"re0\">$item<\/span>.id <span class=\"kw5\">-Force<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Over the years that I have done work ConfigMgr, there was a back and forth on what type of boundaries to use between IPRange and IPSubnet. I have worked in places that were one or the other as well as mixed. Normally, what was used was determined by the suggestion of a Microsoft PFE. Now, &hellip; <a href=\"https:\/\/michaelschultz.net\/tech\/using-powershell-to-fake-converting-configmgr-ipsubnet-to-iprange-boundaries\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using PowerShell to fake converting ConfigMgr IPSubnet to IPRange boundaries&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,14,13,17],"tags":[],"class_list":["post-220","post","type-post","status-publish","format-standard","hentry","category-configmgr","category-powershell","category-scripting","category-sql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p98a2r-3y","post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts\/220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/comments?post=220"}],"version-history":[{"count":5,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts\/220\/revisions"}],"predecessor-version":[{"id":256,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/posts\/220\/revisions\/256"}],"wp:attachment":[{"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/media?parent=220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/categories?post=220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelschultz.net\/tech\/wp-json\/wp\/v2\/tags?post=220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}