Hello,
In your Business Rule you are using the Get-AdmObject cmdlet which only retrieves default property values that do not include the GroupCategory property. While in Windows PowerShell, you are using the Get-AdmGroup cmdlet, which fetches group specific properties. Also, it is recommended to specify the -AdaxesService and the -Server parameters when using Adaxes cmdlets. Finally, your command should look like the following:
$group = Get-AdmGroup -Properties "GroupCategory" -Filter {distinguishedname -eq "%member%"} -AdaxesService localhost -Server "myserver.domain.com"
Additionally, it is not recommended to use the %member% value reference in LDAP filters as it does not always resolve into the distinguished name (DN) of the member added or removed from a group. We recommend you to use the value reference to bind to the group that is added as member and then get its properties as in the below example.
# Bind to member
$group = $Context.BindToObject("Adaxes://%member%")
# Output group category
$groupType = $group.Get("groupType")
if ($groupType -band 0x80000000)
{
$Context.LogMessage("3 + Security", "Information")
}
else
{
$Context.LogMessage("3 + Distribution", "Information")
}