/build/static/layout/Breadcrumb_cap_w.png

Removing profiles

I need to write a cleanup profiles script to automate the removal of profiles. Usually I do this from System Properites, User Profiles and click delete on each one. Firstly I need to find out what profiles are on a machine then I need to be able to remove them using VBscript.

Can anyone help?

0 Comments   [ + ] Show comments

Answers (3)

Posted by: jbonbright 18 years ago
Senior Yellow Belt
0
I've been working on a script to do this myself. I wound up looking at the keys under HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList and enumerating them. Now I have a list of all the SIDs and corresponding user accounts. What I wanted to do next was use those in a command line using "rundll32 userenv.dll,DeleteProfile,<SID>,<Profile_Path>,<Computername> but am having problems getting that to run. It keeps telling me there's a missing entry.

Did you ever get this to work?

BTW, DelProf.exe will NOT work for me. I need to be able to kill a specific profile on a system from a non-interactive script.
Posted by: revizor 18 years ago
Third Degree Blue Belt
0
MS has utility called delprof.exe designed just for that... Search their site...
Posted by: jbonbright 17 years ago
Senior Yellow Belt
0
From my previous post:

"BTW, DelProf.exe will NOT work for me. I need to be able to kill a specific profile on a system from a non-interactive script. "

DelProf.exe was the first thing I tried. I haven't played with it since I posted the original message over a year ago, but I couldn't get it to delete a specific user profile, unbelievably. Just got a WMI book and will explore that route.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ