Deleting old user profiles

SimonB

Member
Reaction score
8
Location
N.Ireland
Hi All,

Has anyone a tested and working script to remove old profiles from Windows PC's. I am aware of scripts that used to work by checking the time the user account was last used but this no longer works due to ntuser file getting modified regardless if the user logged in or not.

Ideally I want something that can be ran remotely on a device or via a RMM.
 
Perhaps run it as a service before any user code gets loaded? Not sure I'd want to do this until and unless the script is absolutely bullet-proof, and I'm struggling to see a Use Case for this capability due to the potential for data loss. I could just see myself testing this script and suddenly the President of the company looses all their data because of some unforeseen edge case!

 
Yeah NTUser updates with every windows update so you cannot nuke profiles automatically via local controls for periods longer than 30 days.

There are however many Intune controls that apply on login that let you delete profiles based on drive consumption, which is quite handy.
 
Back
Top