We use cookies to improve your experience.
By your continued use of this site you accept such use.
For more details please see our privacy policy and cookies policy.

Script Repository

Create an Active Directory Site

May 18, 2020 Views: 2096

The script creates a new Active Directory site.

Note: The script uses cmdlets from Adaxes PowerShell module for Active Directory. To run the script, you need to install the PowerShell Module for Active Directory component of Adaxes.

Edit Remove
Import-Module Adaxes

$givenname = "New Site" # TODO: Modify me
$domain = example.com # TODO: Modify me

# Build path to the container with sites
$domainObj = $Context.BindToObject("Adaxes://$domain")
$domainDN = $domainObj.Get("distinguishedName")
$path =  "CN=Sites,CN=Configuration,$domainDN"

# Create a new site
New-AdmObject -Type Site -Name $givenname -Path $path -Server $domain -AdaxesService localhost

Comments 0
Leave a comment

Got questions?

Support Questions & Answers