How To Add Subnets To Active Directory Sites Using PowerShell

Sites are wonderful things in Active Directory because of how powerful being able to control AD traffic between subnets can be if you have remote sites or even just a lot of sites. Being able to define subnets with PowerShell makes our lives as administrators a whole lot easier.

In this snip, Anthony will run you through adding subnets to Active Directory sites using PowerShell. He’ll introduce you to retrieving a site’s current subnets using Get-ADReplicationSubnet and then how to create a new one using the New-ADReplicationSubnet cmdlet. This will enable you to easily script imports of subnets from your network team, or even from your DHCP server if you need to.

Prerequisites include: - Active Directory PowerShell module