Reply To: Delete 'User Profiles' using SCCM

  • Topaz George

    Organizer
    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.