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.
PowerShell
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