Hello
I have a piece of code that troubles me:
Import-Module Adaxes
# $Server = $Context.GetObjectDomain("%distinguishedName%")
$Advisgruppe = "%distinguishedName%"
$Member = $Context.BindToObject("Adaxes://%member%")
$UserFullName = $Member.Get("name")
$TheUserCpr = $Member.Get("employeeNumber")
$TheUserOffice = $Member.Get("physicalDeliveryOfficeName")
# For debug
$Context.LogMessage("Bruger: " + $UserFullName, "Information")
$Context.LogMessage("AdvisGruppe: " + $Advisgruppe, "Information")
-----
If executed directly as a Powershell part of a Business Rule, that fires before adding a user to a group, it works okay (the target user is the right one):
If executed from the same Business Rule, but now as a Custom Command (Object type: group) , the target user is wrong:
I've reused the code from another BR/CC combination, except for one thing. In the other combinations, the Activity Scope is an OU (subtree).
In the case above, it is a specific security group.
- Thanks