Creating business units

The following code sample creates a business unit.


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

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

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

$rules = $unit.GetMembershipRules()
# [TODO] specify membership rules


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

See also