Script Repository


Create an Active Directory Site

September 04, 2015
1057

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


 


Comments ( 0 )
No results found.
Leave a comment