@Anant Bera, Thanks for posting in Q&A. To remove the device from Intune via PowerShell script, we can run the following script. For the script, it deletes the device in Intune portal. After the deletion, the device will not be managed by Intune.
https://www.fisontech.net/p/day-57-remove-intune-devices-with-powershell/
Note: Non-Microsoft link, just for the reference.
But the account on the device side will be still kept. To remove it, you can run the following command to remove the account information.
Get-ItemProperty -Path "C:\Users\*\AppData\Local\Packages" | ForEach-Object { Remove-Item -Path "$_\Microsoft.AAD.BrokerPlugin*" -Recurse -Force | Out-Null }
You can try the above command and hope the above information can help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.