Jump to content

Recommended Posts

Posted

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

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

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...