Powershell Project – Remove Profiles and Registry Entries for Users No Longer Logged On


This is an issue that I have found annoyingly common on Windows 2003 servers running Citrix over the years. For these servers you can use REMPROF to remove the orphaned users profiles and registry HKU entries, but I have found that this utility does not work for Windows 2008 R2.  With that I intend to plan out and create a script that will do the job via Powershell.

I am quite new to the use of Powershell and so I will list out the all of the steps that I go through to create the script.

The Pseudo Code for the Script:
Check logged on users
Check C:\Users for Folders
Check Registry SIDs in HKU

ForEach Folder not attached to a logged on user
Delete C:\Users\ folder

ForEach SID not attached to a logged on user
Delete HKU\SID Key

I will update this post again once I have the base set of code required to start this off

Keep Watching

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: