To create a list of all subnets belonging to an AD site requires a lot of manual work, especially as the environment gets larger. However, there is of course another way to retrieve Active Directory subnets with PowerShell.
I thought about how to automate AD sites with PowerShell – and found a solution. At the end of this article, I provide a complete script to create sites in Active Directory with a CSV-file. The article includes detailed explanation, screenshots and examples.
- PowerShell: Find active computer objects
- Nesting groups in Active Directory
- Create home directory and grant permissions with PowerShell
- Creating an individual random password with PowerShell
- Retrieve Active Directory subnets with PowerShell
- Editing users of other domains – with PowerShell
- Azure Basics: Connecting with Azure (PowerShell)
- PowerShell Custom Objects
- Logon Script does not start on Windows Server 2012 R2 domain
- IsMember – Check group membership in Active Directory