Jump to content

Windows Virtual Desktop (Windows 10 Multi-Session)


Recommended Posts

Posted
I am try to clear out everyone's download folder that logs into our WVD which we have set a 15 users.I run this PS script but it only clears the download folder for who is logged in.Remove-Item -Path $env:UserProfile\Downloads\*.* -Recurse -ForceI am sure it just needs tweaking but I can't seem to figure it out.Any help would be great thanks!
Posted (edited)

get-childitem c:\users | % { "c:\users\" + $_.Name + "\Downloads" }

or

get-childitem c:\users | % { "c:\users\$($_.Name)\Downloads" }

 

This will just echo back the full path, but should give you enough the expand with Remove-Item commands (I don't want to post the exact command as it is a bit dangerous if folks copy and paste)

Edited by AlexB
Posted

Hi I am knew to PS and have tried different ways to expand the Remove-Item command and not getting it.

Would you mind send me the way to get it done directly to my email? This would be greatly appreciated and would help be learn how it works.

 

[email protected]

Posted (edited)

PM sent.

 

For those that need to put it together in the future, wrap

"c:\users\$($_.Name)\Downloads\*"

with either side of

Remove-Item -Path

and

-Recurse -Force

 

(needs running as admin)

Edited by AlexB
  • 4 weeks later...
Posted

What we ending up doing for WVD Multi-Session hosts was putting the access group into the local Guest group on the host with a group policy (Computer Configuration\Preferences\Control Panel Settings\Local Users and Groups\). What this does is when the user logs out the data in the user profile is removed from the host basically making it a non-persistent profile. The one downside we did find with this is that all Microsoft Store based apps don't work as they can't be opened with a Guest use. The big one was calculator had to find a legacy calculator app (https://winaero.com/get-calculator-from-windows-8-and-windows-7-in-windows-10/).

 

Could use a logoff script to delete the downloads that runs as the user but they would have access to delete their own downloads

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