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.

DCOM hardening issue.

This application fails to authenticate with WMI on the SCCM server because Microsoft has not yet hardened DCOM on their Windows Preinstallation Environment. We are working on a different approach, but it will only be released during the first quarter of 2024. But until that time, the only workaround will be to uninstall the update corresponding to KB5004442.