mansin Posted July 27, 2018 Posted July 27, 2018 How are people deleting locally cached network profiles from Windows 10 stations? I know there a GPO to do this but it doesn't seem to work well. I've been trying to run the following powershell commands but not luck. Get-WmiObject Win32_UserProfile | Where-Object {$_.Special -eq $False} | Remove-WmiObject The above errors: Remove-WmiObject : At line:1 char:74 + ... UserProfile | Where-Object {$_.Special -eq $False} | Remove-WmiObject + ~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ( [Remove-WmiObject], FileLoadException + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.RemoveWmiObject Need something like this to work but also preferably deleting the profile on Logoff. Any ideas please? Thanks Manny
deano3693 Posted July 27, 2018 Posted July 27, 2018 Scheduled Task with delprof run as SYSTEM. How are you deploying this to all machines - I'm interested in doing this as above have stated the GPO doesn't seem to work very well on Win10. Regards, Dean.
free780 Posted July 27, 2018 Posted July 27, 2018 A Group Policy Preference for a scheduled task. Or a script deployed via SCCM.
mansin Posted August 1, 2018 Author Posted August 1, 2018 Just wanted to say thanks for the suggestions but I've gone down a different route. I've used this one line as a PowerShell script and set it as a startup script. It works perfectly. Get-WMIObject -class Win32_UserProfile | Where {(!$_.Special)} | Remove-WmiObject Thanks again.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now