Delete 'User Profiles' using SCCM

  • Delete 'User Profiles' using SCCM

    Posted by Sarah Hill on 21 July 2020 at 1:17 pm

    How can I use SCCM to delete Windows 10 user profiles that have not been used in the last 60 days? We have a lot of kiosk devices used by 100’s of users. Month’s on we see a lot of local profiles on the device; a lot of them have not been used in over 60 days.

    Topaz George replied 2 years, 10 months ago 2 Members · 1 Reply
  • 1 Reply
  • Topaz George

    21 July 2020 at 1:23 pm

    Use the below script to delete user profiles using PowerShell.

    Get-CimInstance win32_userprofile -verbose | Where {$_.LastUseTime -lt $(Get-Date).Date.AddDays(-60)} | Remove-CimInstance -Verbose

    You could deploy the above script using the following methods.

    • SCCM package.
    • SCCM Run Script.

    This is normally a one off activity so I prefer the ‘Run Script’ function. Hope this helps.