Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [cmdletbinding()]
  2. param()
  3. $Sites = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().Sites
  4. foreach ($Site in $Sites) {
  5. $Obj = New-Object -Type PSObject -Property (
  6.   @{
  7.  
  8.    "SiteName" = $Site.Name;
  9.    "SubNets" = $Site.Subnets;
  10.    "Location" = $Site.Location;
  11.  
  12.   }
  13.  
  14.  )
  15.  
  16. $Obj
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement