Avatar of samiam41
samiam41
Flag for United States of America asked on

Delete user profiles Windows 7

Hey Experts.  I've tried putting together a PS script to delete user profiles that are not related to the default user accounts (local admin, etc).  The environment is Win 7 Enterprise and will be applied to the training room computers which have been getting killed by user profiles eating up drive space.  Your time/help is appreciated.
PowershellWindows 7

Avatar of undefined
Last Comment
samiam41

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Brian Murphy

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
samiam41

ASKER
Brilliant work!  Thank you for your help!
PeeterB

Just to add, one other way of doing it (which we have used successfully for many years) is to put a particular AD user group into the lab pc's local 'Guests' group ..... guest users profiles get deleted on logout ...
i.e on the client side run 'net localgroup guests domain\usergroup /add'

note: there might be some extra restrictions that are enforced onto the guests group ... but never caused any problems here ...

(edit) ... apologies, please ignore ...... hadn't realized issue is already solved ....
samiam41

ASKER
All good PeeterB!  I appreciate the information.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy