This PowerShell script sample shows how to delete user profiles older than a specified number of days.
The computer usually used by more than one person, this often produces a large number of unique user profiles. Some of profiles are needless. (Profiles that have not been accessed in the past 60 days), users would like to clean up these legacy profiles. If we can provide a script that can help user to delete user profiles that is older than a specified number of days, it would be very helpful.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery