Deleting property patterns

The following code sample deletes a property pattern.

[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 pattern
$propertyPatternsPath = $service.Backend.GetConfigurationContainerPath("PropertyPatterns")
$propertyPatternsPathObj = New-Object "Softerra.Adaxes.Adsi.AdsPath" $propertyPatternsPath
$propertyPatternAdsPath = $propertyPatternsPathObj.CreateChildPath("CN=My Pattern")

$myPropertyPattern = $service.OpenObject($propertyPatternAdsPath, $null, $null, 0)

# Delete the property pattern
$myPropertyPattern.DeleteObject("ADM_DELETEOBJECTFLAGS_AUTO")

See also