Hi @Chandra Mounika Katta ,
per your problem description, I cannot confirm the version of SharePoint you are using. May I know the version of SharePoint you are using?
According to my research, deleting Inactive users from all SharePoint sites is essentially deleting Inactive users from AD. I found some articles for your reference:
https://devblogs.microsoft.com/scripting/use-powershell-to-find-and-remove-inactive-active-directory-users/
https://learn.microsoft.com/en-us/services-hub/health/remediation-steps-ad/regularly-check-for-and-remove-inactive-user-accounts-in-active-directory
https://cloudinfrastructureservices.co.uk/find-inactive-users-in-active-directory-using-powershell-script/
https://spandcrm.com/2017/12/12/sharepoint-2013-how-to-automatically-remove-disabled-active-directory-users/#:~:text=Access%20'Manage%20Service%20Applications'.,'User%20Profile%20Service%20application'.&text=Locate%20the%20'My%20Site%20Cleanup,users%20being%20removed%20from%20SharePoint.
https://www.lepide.com/how-to/manage-inactive-accounts-in-active-directory.html
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
Regards,
*
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.