Jump to content
Welcome to our new Citrix community!
  • 0

Delete old FSLogix profiles


Dennis Haschke

Question

8 answers to this question

Recommended Posts

  • 0

Hi, 

 

No there is no default settings which allows you to delete old profiles. 

You could make a script which deletes those.

 

# Delete all Files in D:\Profiles older than 30 day(s)

$Path = "D:\Profiles"

$Daysback = "-30"  

$CurrentDate = Get-Date

$DatetoDelete = $CurrentDate.AddDays($Daysback)

 

Get-ChildItem $Path -Recurse ( | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Remove-Item

 

Create a Powershell script that you schedule every day or once a month. change the Path and Day as you prefer. 

  • Like 1
Link to comment
  • 0

:-)
That was the prompt of the screenshot.

This is the script:
# Delete all Files in C:\FSLogix older than 90 day(s)
$Path = "C:\FSLogix"
$Daysback = "-90"  
$CurrentDate = Get-Date
$DatetoDelete = $CurrentDate.AddDays($Daysback)
Get-ChildItem $Path -Recurse ( | Where-Object { $_.LastWriteTime -lt $DatetoDelete }

But then i get the error above.

Link to comment

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