Hello,
It is possible to get the previous value, but only before it was changed. As a workaround, you can use a Business Rule triggered before updating a user. The Business Rule will save the old username to a certain property of the user. For this purpose you can use Adaxes virtual properties that can store text data, for example, CustomAttributeText1. Then, in your Business Rule that updates the database, that is most probably triggered after updating a user, you can access that virtual property to get the previous username.
To get the old username before it is updated, you need to use a PowerShell script. For example, you can use the following PowerShell script that saves the username to a the virtual property called CustomAttributeText1:
$oldUsername = $Context.TargetObject.Get("sAMAccountName")
$Context.TargetObject.Put("adm-CustomAttributeText1", $oldUsername)
$Context.TargetObject.SetInfo()
To be able to run the above script, you need to create a Business Rule triggered Before Updating a User that executes the Run a program or PowerShell script action.
Then, in your script that updates the database, you can access the old username with the following code, for example:
$oldUsername = $Context.TargetObject.Get("adm-CustomAttributeText1")