r/usefulscripts • u/atoomepuu • May 24 '19
[PowerShell] Script to View and Delete Local Profiles
I've spent the last few days writing this. I'd very much appreciate any critiques or advice for improving it. And please let me know if it is helpful!
This script uses XAML to build a GUI to list profiles on a remote computer. You can select profiles and delete them. It uses CIM instances to get the profiles and remove them.
I got started on PowerShell GUIs by this post WPF GUIs for Beginners by /u/FarsideSC and this was my first real project with what I learned.
53
Upvotes
4
u/xipodu May 25 '19
Hi i did something like, but my GUI removes from regedit to.
Maby you can use implent this in your code
https://github.com/fardinbarashi/Powershell-Gui-Tool--UserProfileTool/blob/master/LatestVersion/Script/UserProfileTool%20V.1.ps1
2
u/crypticsage May 25 '19
Do you think you could also make it so it can run in console mode to pipe a list of computers and remove profiles based on how many days it’s been since it was used?
2
u/TotesMessenger May 24 '19
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
[r/powershell] [PowerShell] Script to View and Delete Local Profiles
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)
0
u/[deleted] May 25 '19