Good afternoon good people,
I’m after creating a small script to delete user profiles daily (both their regedit entries and folder so that it is a “clean” delete).
When I simply do “Remove-WmiObject -class Win32_UserProfile” in my test environment well… it wipes “it”.
I suspect I can use get-WMIObject to set a where “this conditions” similar to SQL but I have just started with my PowerShell so I’m a bit lost as to how achieve this?
I’m after deleting all users daily upon reboot (For an RD server). There’s a GPO that can achieve this with profiles older than 1 day, but I want to delete profiles regardless of anything daily.