Hello,
The solution from the Q&A article you referenced will not work for the msRADIUSFramedIPAddress property as it is of the Integer type. Also, we are not sure why you are trying to save the IP address to a binary property. To be able to see it as is, a text attribute (e.g. CustomAttributeText1) should be used. You can try the below script.
function ConvertRADIUSIPAddress($RADIUSIPAddress)
{
$bin=[convert]::ToString([int32]$RADIUSIPAddress,2).PadLeft(32,'0').ToCharArray()
$A=[convert]::ToByte($bin[0..7] -join "",2)
$B=[convert]::ToByte($bin[8..15] -join "",2)
$C=[convert]::ToByte($bin[16..23] -join "",2)
$D=[convert]::ToByte($bin[24..31] -join "",2)
return $($A,$B,$C,$D -join ".")
}
$targetProperty = "msRADIUSFramedIPAddress" # TODO: modify me
$updatePropertyName
# Get property value
try
{
$integerValue = $Context.TargetObject.Get($targetProperty)
}
catch
{
$Context.LogMessage("Property $targetProperty is empty", "Warning")
return
}
# Convert property value to IP address
$ipAddress = ConvertRADIUSIPAddress $integerValue
# Update the user
$Context.TargetObject.Put("adm-CustomAttributeText1", $ipAddress)
$Context.TargetObject.SetInfo()