Creating property patterns
The following code sample creates a property pattern. The pattern will mark the Description property of user accounts as required.
[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 'Property Patterns' container
$propertyPatternsPath = $admService.Backend.GetConfigurationContainerPath(
"PropertyPatterns")
$propertyPatternsContainer = $admService.OpenObject($propertyPatternsPath,
$NULL, $NULL, 0)
# Create new property pattern
$pattern = $propertyPatternsContainer.Create("adm-PropertyPattern",
"CN=My Pattern")
$pattern.ObjectType = "user"
$pattern.Description = "My description"
$pattern.Disabled = $False
$pattern.SetInfo()
$item = $pattern.Items.Create()
$item.PropertyName = "description"
$item.IsPropertyRequired = $True
$item.SetInfo()
$pattern.Items.Add($item)
See also
- Managing property patterns
- Binding to Adaxes-specific objects
- Managing Adaxes-specific objects
- IADs
- IADsContainer
- IAdmPropertyPattern
- IAdmPropertyPatternItem
- Online script repository