I may have to cleanup the inactive users, so thought of using the 'Remove-SPUser' cmdlet as below.
Remove-SPUser -Identity "demo.net\karthik" -Web http://demo.net/testA/testA1/testA1a -Confirm:$false
What is the negative side of 'Remove-SPUser' in SharePoint 2010?
I observed that the user permission is removed from the entire site collection('demo.net') instead of the specific web('testA1a') which is fine in my case.
However, how does it differ from the below?
Get-SPSite "http://demo.net" | Get-SPWeb -Limit All | Remove-SPUser -Identity "demo.net\karthik"
Also, It removes the user profile from the User information list however it does not affect the existing references(like created by/modified by etc)