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?
Can anyone help?
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
jbonbright
18 years ago
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.
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
Posted by:
jbonbright
17 years ago
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.
"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.
so that the conversation will remain readable.