Skip to content

Instantly share code, notes, and snippets.

@PixelRobots
Created April 22, 2017 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PixelRobots/35076a4b7f219cb68d13fde30cacf607 to your computer and use it in GitHub Desktop.
Save PixelRobots/35076a4b7f219cb68d13fde30cacf607 to your computer and use it in GitHub Desktop.
# Add subnet to sites and service
Write-Host "Add Subnet to Site"
$Subnet = read-host "Enter subnet in format 10.10.10.0/24"
$desc = read-host "Enter description eg: 10.10.10.0/255.255.255.0"
New-ADObject -Name:$subnet -Type subnet -Description:$desc -OtherAttributes @{location="Yellow-Pixel";siteObject="CN=Yellow-Pixel,CN=Sites,CN=Configuration,DC=ad,DC=testpixels,DC=co,DC=uk"} -Path "CN=Subnets,CN=Sites,CN=Configuration,DC=ad,DC=testpixels,DC=co,DC=uk"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment