That is correct that I hadn't accounted for the empty attribute. I've applied your script and it does now handle this scenario gracefully.
That being said, the attribute is not empty in the on prem AD user object. It is populated which is why the report caclulates properly when it is run against the on prem AD group.
The issue seems, as I am understanding more, is the Azure user object does not have a value assigned to it. Since the report is being run against the Azure AD group, which holds the Azure user objects, it sees the empty custom fields.
This brings us to the root of the issue. I have a business rule which adds the %datetime% in the custom attribute (which you guys did just help me with a couple of days ago), but it places it in the on prem user object and not both the on prem and azure object.
Here is the script that does this (and adds to another group, which is the on prem AD group as I was trying to implement a work around).
$dateProperty = "adm-CustomAttributeDate14" # TODO: modify me
$targetGroupDN = "CN=MFA-Bypass-Report,OU=Reports,OU=Groups,DC=corp,DC=res,DC=us" # TODO: modify me
# Bind to new member
$member = $Context.BindToObject("Adaxes://%member%")
# Update new member
$member.Put($dateProperty, "%datetime%")
$member.SetInfo()
$group = $Context.BindToObjectByDN($targetGroupDN)
if (-not $group.IsMember("Adaxes://%member%"))
{
$group.Add("Adaxes://%member%")
}
So in this case, is this expected behavior and we need to adjust the script to assign the value on both objects or should this happen automatically but it isn't? Or some other methodology - like Adaxes should know to look in the Active Directory user even though the user in the cloud group is the cloud user object etc....