Skip to content

Deleting Property Patterns

The following code sample deletes a Property Pattern.

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

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

# Bind to 'My Pattern' Property Pattern
$propertyPatternsPath = $admService.Backend.GetConfigurationContainerPath(
    "PropertyPatterns")
$propertyPatternsPathObj = New-Object "Softerra.Adaxes.Adsi.AdsPath" `
    $propertyPatternsPath
$propertyPatternAdsPath = $propertyPatternsPathObj.CreateChildPath( `
    "CN=My Pattern")
$myPropertyPattern = $admService.OpenObject($propertyPatternAdsPath, $NULL, $NULL, 0)

# Delete the Property Pattern
$myPropertyPattern.DeleteObject("ADM_DELETEOBJECTFLAGS_AUTO")

See also