Hi Ritesh,
As far as I know there is no way you can write back User is active or performing any activity on the AAD and write back to Onprem AD, there are some exchange attributes that I used for other project but it was oneoff for shared mailbox. IN this case you will need to update your script as this is not a solution in your scenario you are using AAD Joined device and users remotely loggin, so you need something setup in AAD instead of Onprem or tweak your onprem scrpts to accomodate this scenario - https://learn.microsoft.com/en-us/azure/active-directory/hybrid/connect/reference-connect-sync-attributes-synchronized#exchange-hybrid-writeback
Hope this helps.
JS
==
Please accept as answer and do a Thumbs-up to upvote this response if you are satisfied with the community help. Your upvote will be beneficial for the community users facing similar issues.