Hello,
Here's a sample script that shows how to register a domain with the help of Adaxes ADSI API:
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$domainFqdn = "mydomain.com" # TODO: modify me
$adminCredential = Get-Credential "MYDOMAIN\Administrator" # TODO: modify me
# Connect to the Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")
# Bind to the 'Managed Domains' container
$managedDomainsPath = $admService.Backend.GetConfigurationContainerPath(
"ManagedDomains")
$managedDomainsContainer = $admService.OpenObject($managedDomainsPath, $NULL, $NULL, 0)
# Create a new managed domain
$managedDomain = $managedDomainsContainer.Create("adm-ManagedDomain", "DC=$domainFqdn")
$managedDomain.SetInfo()
# Provide logon information
$user = $adminCredential.UserName
$password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($adminCredential.Password))
$managedDomain.Register($user, $password)
In the script:
- $domainFqdn - the FQDN of the domain that you are trying to register,
- $adminCredential - the credentials that will be used by Adaxes to connect to the domain and perform operations in it.
As to the script dealing with Password Self-Service Policies, it will take more time to complete. Since we are on the very final stages of preparing for the Adaxes 2013.1 release, our script guy is overloaded with urgent tasks. Sorry for the inconvenience, but we'll be able to make the second sample script only after the new release is available.
By the way, can you clarify on how specifically would you like to configure Password Self-Service Policies with scripts? Can you describe your tasks in more detail?