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 the 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
- Managing property patterns
- Binding to Adaxes-specific objects
- Managing Adaxes-specific objects
- IADsDeleteOps
- Online script repository