trigger can be anything (if I add scope bind to the same group manually, rule gets triggered)
script + parameters:
$ruleADSPath = '<ADSPathOfTheAdaxesRule>'
$baseObjectDN = '<DNofTheADObject>'
$type = 'ADM_SCOPEBASEOBJECTTYPE_GROUP'
$exclude = $false
$inheritance = 'ADS_SCOPE_BASE'
$null = [Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
# connect to the Adaxes service
$adaxesService = "localhost"
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly($adaxesService)
# get base object
$baseObj = $admService.OpenObject("Adaxes://$baseObjectDN", $null, $null, 0)
# get business rule
$rule = $admService.OpenObject($ruleADSPath, $null, $null, 0)
# add new scope to the business rule
$scopeItem = $rule.ActivityScopeItems.Create()
$scopeItem.BaseObject = $baseObj
$scopeItem.Type = $type
$scopeItem.Inheritance = $inheritance
$scopeItem.Exclude = $exclude
$scopeItem.SetInfo()
$rule.ActivityScopeItems.Add($scopeItem)
$rule.SetInfo()
I am guessing that problem is in the "save" action, but I've tried setOption() too without any luck.