none
PowerShell Script to Clean User Profiles File Location RRS feed

  • Question

  • Hello,

    I have been searching around to accomplish what I am trying to do. It is pretty basic so I am hoping someone can point me in the right direction. I want to write a powershell script to clean out two locations in all the user profiles on a Citrix server. Here are the steps I'd like to accomplish.

    1. Find all user profiles on the Citrix server

    2. Delete all the files from these two locations; "\Local Settings\Application Data\Mozilla\*.*" and "\Local Settings\Application Data\Microsoft\OneNote\*.*"

    This will run on a weekly basis via a scheduled task. A nice to have would be to add any profile over 60 days old.

    I have a pretty good start, but I am still learning PowerShell, so any help would be appreciated.

    Thanks in advance!


    Thanks, Jeremy

    Monday, February 3, 2014 4:02 PM

Answers

  • Very fair reply. Actually, I just came across a script posted by Jaap Brasser called "deleteold.ps1", this will do the trick with some tweaks.

    Thanks!


    Thanks, Jeremy

    • Marked as answer by maybewecan Monday, February 3, 2014 4:27 PM
    Monday, February 3, 2014 4:26 PM

All replies

  • Hello mbwc,

    how about showing us what you got so far and detail where you have trouble?

    That way, we can help you understand your problems and find the solution yourself (= good for learning), instead of having one of us simply provide the solution (= bad for learning).

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Monday, February 3, 2014 4:06 PM
  • Very fair reply. Actually, I just came across a script posted by Jaap Brasser called "deleteold.ps1", this will do the trick with some tweaks.

    Thanks!


    Thanks, Jeremy

    • Marked as answer by maybewecan Monday, February 3, 2014 4:27 PM
    Monday, February 3, 2014 4:26 PM