Sorry, search feature is not supported in Internet Explorer 11

Creating business unit containers

The following code sample creates a container for business units.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

# Connect to the Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")

# Bind to the 'Business Units' container
$businessUnitsPath = $admService.Backend.GetConfigurationContainerPath(
    "BusinessUnits")
$businessUnitsContainer = $admService.OpenObject($businessUnitsPath,
    $NULL, $NULL, 0)

# Create container
$myContainer = $businessUnitsContainer.Create("container","CN=My Container")
$myContainer.SetInfo()

The following code sample creates a business unit in a specific container.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

# Connect to the Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")

# Bind to the 'My Container' container
$businessUnitsPath = $admService.Backend.GetConfigurationContainerPath(
    "BusinessUnits") 
$businessUnitsPathObj = New-Object "Softerra.Adaxes.Adsi.AdsPath"`
    $businessUnitsPath
$myContainerPath = $businessUnitsPathObj.CreateChildPath("CN=My Container")
$myContainer = $admService.OpenObject($myContainerPath, $NULL, $NULL, 0)

# Create business unit
$myBusinessUnit = $myContainer.Create("adm-BusinessUnit", "CN=My Unit")
$myBusinessUnit.Description = "My description"

# [TODO] specify membership rules

$myBusinessUnit.SetInfo()

Tip

For information on how to define membership rules for a business unit, see Modifying membership rules.

See also