Creating property pattern containers
The following code sample creates a container for property patterns.
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
# Connect to the Adaxes service
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly("localhost")
# Bind to the 'Property Patterns' container
$propertyPatternsPath = $service.Backend.GetConfigurationContainerPath(
"PropertyPatterns")
$propertyPatternsContainer = $service.OpenObject($propertyPatternsPath,
$null, $null, 0)
# Create container
$myContainer = $propertyPatternsContainer.Create("container","CN=My Container")
$myContainer.SetInfo()
The following code sample creates a property pattern in a specific container.
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
# Connect to the Adaxes service
$ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$service = $ns.GetServiceDirectly("localhost")
# Bind to the 'My Container' container
$propertyPatternsPath = $service.Backend.GetConfigurationContainerPath(
"PropertyPatterns")
$propertyPatternsPathObj = New-Object "Softerra.Adaxes.Adsi.AdsPath"`
$propertyPatternsPath
$myContainerAdsPath = $propertyPatternsPathObj.CreateChildPath("CN=My Container")
$myContainer = $service.OpenObject($myContainerAdsPath, $null, $null, 0)
# Create property pattern
$pattern = $myContainer.Create("adm-PropertyPattern", "CN=My Pattern")
$pattern.ObjectType = "user"
$pattern.Description = "My description"
$pattern.Disabled = $false
$pattern.SetInfo()
See also
- Managing property patterns
- Binding to Adaxes-specific objects
- Managing Adaxes-specific objects
- IADs
- IADsContainer
- IAdmPropertyPattern
- Online script repository