Hello Debarase,
You can use the following script to update the Description of an object with the name of its grand parent.
# Get grand parent DN
$grnadParentDN = (New-Object "Softerra.Adaxes.Ldap.DN" "%adm-ParentDN%").Parent
if ($grnadParentDN.Leaf.Type -eq "DC")
{
$Context.LogMessage("Grand parent of object %fullname% is not an OU or container.", "Warning")
return
}
# Update object description
$Context.TargetObject.Put("Description", $grnadParentDN.Leaf.Value)
$Context.TargetObject.SetInfo()