January 16, 2013

PowerShell - Active Directory Sites

How to get list of sites and associated subnets from Active Directory via PowerShell?

Get-ADObject -Filter 'ObjectClass -eq "site"' -SearchBase 'CN=Configuration,DC=example,DC=com' -Properties * | foreach {$_.name,$_.siteObjectBL} | out-file C:\sites.csv

Where example.com is Active Directory Domain

No comments:

Post a Comment