Delete User Profile

xarden

New member
Guru
Local time
2:55 PM
Messages
905
Location
Auckland
Hi all,
I'd like to delete students cached profile when they log out.
Apparently, delprof.exe does not with with Win7, and the method has been replaced with the GPO setting
ComputerConfig>Admin Templates>System>User Profiles>Delete Cached Copies of Roaming Profiles.

However, this is happening at the Workstation level. Preferably I'd like to get it done at a User level, so I can add it to the User-Student GPO.
I dont want the lecturers profiles to be deleted, just the students.

We also dont want to use any 3rd party tools.

Any suggestions?
Regards,
 

My Computer

OS
Windows 7 Enterprise
CPU
Intel Pentium Dual E2200 @2.2GHz
Motherboard
Gigabyte II-G31
Memory
4GB
Graphics Card(s)
Palit GForce 9500GT 1GB
Sound Card
onBoard
Hard Drives
WesternDigital: 250GB + 1TB + 1TB + 2TB
PSU
450W
Case
CoolerMaster CM690
Cooling
Corsair H50
Mouse
Logitech MX518
Hello xarden, I see this has gone unanswered, I have no experience in this area, but in Googling I found something close I believe. Perhaps with this at the top, someone else will have an answer if this doesn't help you.

Windows 7 profile remote deletion.

A Guy
 

My Computer

Computer type
PC/Desktop
OS
Windows 10 Home x64
CPU
INTEL Core i5-750 Quad-Core 3.37GHz
Motherboard
ASUS P7P55D
Memory
HyperX Fury Black Series 8GB (2 x 4GB) 1866Mhz
Graphics Card(s)
EVGA GeForce GTX 750 Superclocked 1GB 128-Bit GDDR5
Monitor(s) Displays
LG 32MA68HY 32" IPS
Screen Resolution
1920 x 1080
Hard Drives
Samsung 840 Evo 120GB, SEAGATE 500GB Barracuda® 7200.12, SATA 3 Gb/s, 7200 RPM, 16MB cache
PSU
ANTEC TruePower New TP-550, 80 PLUS, 550W
Case
ANTEC Three Hundred Illusion
Cooling
COOLER MASTER Hyper 212 Plus, 4 x 120mm 1 x 140mm Noctua's
Internet Speed
85 + Mbps
Antivirus
Avast
Browser
Vivaldi
Thanks A Guy,
I saw that thread too when googling.
The issue with that one is if I specify a number of days, such as 3, the machine will accumulate 3 days worth of students profiles (about 6 a day, assuming students use a different machine each day).

If I specify anything less, the lecturers profile will get deleted over the weekend.

And just to throw a spanner into the works, some admin staff use multiple machines for days at a time, so this setting wouldnt work well for them either.

Its kind of a shame that the computerConfig settings wont get applied if its in the Accounts policy... else this would work.
 

My Computer

OS
Windows 7 Enterprise
CPU
Intel Pentium Dual E2200 @2.2GHz
Motherboard
Gigabyte II-G31
Memory
4GB
Graphics Card(s)
Palit GForce 9500GT 1GB
Sound Card
onBoard
Hard Drives
WesternDigital: 250GB + 1TB + 1TB + 2TB
PSU
450W
Case
CoolerMaster CM690
Cooling
Corsair H50
Mouse
Logitech MX518
Why not write a script that uses the Win32_UserProfile class to delete unused profiles, or specific profiles?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows 10 Pro x64
CPU
Intel Core i7 4790K @ 4.5GHz
Motherboard
Asus Maximus Hero VII
Memory
32GB DDR3
Graphics Card(s)
Nvidia GeForce GTX970
Sound Card
Realtek HD Audio
Screen Resolution
1920x1200
Hard Drives
1x Samsung 250GB SSD
4x WD RE 2TB (RAIDZ)
PSU
Corsair AX760i
Case
Fractal Design Define R4
Cooling
Noctua NH-D15
Because that would the logical thing to do. I like to make things as difficult as possible.

But when the coffee isnt talking, thats probably the good way to go...
I've got the image coming down now, so I'l try write something up and test it later today.

Thanks for your suggestion, will keep you posted how it works out.
 

My Computer

OS
Windows 7 Enterprise
CPU
Intel Pentium Dual E2200 @2.2GHz
Motherboard
Gigabyte II-G31
Memory
4GB
Graphics Card(s)
Palit GForce 9500GT 1GB
Sound Card
onBoard
Hard Drives
WesternDigital: 250GB + 1TB + 1TB + 2TB
PSU
450W
Case
CoolerMaster CM690
Cooling
Corsair H50
Mouse
Logitech MX518
Very funny :)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows 10 Pro x64
CPU
Intel Core i7 4790K @ 4.5GHz
Motherboard
Asus Maximus Hero VII
Memory
32GB DDR3
Graphics Card(s)
Nvidia GeForce GTX970
Sound Card
Realtek HD Audio
Screen Resolution
1920x1200
Hard Drives
1x Samsung 250GB SSD
4x WD RE 2TB (RAIDZ)
PSU
Corsair AX760i
Case
Fractal Design Define R4
Cooling
Noctua NH-D15
What I would do is run a PowerShell logoff script with and set the Scope to groups 1 and 2. The PowerShell script would compare the logged in user to that of users in 1 of 2 groups and if true delete profile or leave alone. I know it sounds easier than it is. But thats the theory at least.

I don't see how you can manage this cleanly without intergrating with the Security Groups held in Active Directory. I can help out with some of the code if you like.

The PowerShell Get-ADGroup cmdlet seems like a good place to start.
http://technet.microsoft.com/en-us/library/ee617196.aspx

Nick
 

My Computer

Computer Manufacturer/Model Number
Optiplex 960
OS
Windows 7 Enterprise 64bit
CPU
Dual Quad-Core
Memory
8GB
Graphics Card(s)
NVidia Quadro NVS 450
Monitor(s) Displays
3 Monitors - ViewSonic VP2030b 21in-
Hard Drives
Raid configuration with 300GB
Other Info
Also owne a Tablet x61 Lenovo Laptop
That would be the best way - users whose profiles you don't want to whack in one group, users whose profiles should be removed in another. Given that Win32_UserProfile also gives the last used date, you could use that as a variable as well.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows 10 Pro x64
CPU
Intel Core i7 4790K @ 4.5GHz
Motherboard
Asus Maximus Hero VII
Memory
32GB DDR3
Graphics Card(s)
Nvidia GeForce GTX970
Sound Card
Realtek HD Audio
Screen Resolution
1920x1200
Hard Drives
1x Samsung 250GB SSD
4x WD RE 2TB (RAIDZ)
PSU
Corsair AX760i
Case
Fractal Design Define R4
Cooling
Noctua NH-D15
It should be a sweet and simple script.
 

My Computer

Computer Manufacturer/Model Number
Optiplex 960
OS
Windows 7 Enterprise 64bit
CPU
Dual Quad-Core
Memory
8GB
Graphics Card(s)
NVidia Quadro NVS 450
Monitor(s) Displays
3 Monitors - ViewSonic VP2030b 21in-
Hard Drives
Raid configuration with 300GB
Other Info
Also owne a Tablet x61 Lenovo Laptop
Attached is a script I found online to delete user profiles using the win32_userprofile class Cluberti suggested.

What it does, is look for all users and has a msgbox popup asking whether to delete the user profile.

I've added lines to exlude and ignore system users (s-1-5-18, s-1-5-19, s-1-5-20).
Will need to exclude local admins, so will be doing that later this week.

When run manually, it'll detect all previous users and prompt to delete their profiles.
It'l fail to delete the current user, because they are still logged in.
So I'l still need to work on getting that done at logout.

View attachment delprof.vbs
 

My Computer

OS
Windows 7 Enterprise
CPU
Intel Pentium Dual E2200 @2.2GHz
Motherboard
Gigabyte II-G31
Memory
4GB
Graphics Card(s)
Palit GForce 9500GT 1GB
Sound Card
onBoard
Hard Drives
WesternDigital: 250GB + 1TB + 1TB + 2TB
PSU
450W
Case
CoolerMaster CM690
Cooling
Corsair H50
Mouse
Logitech MX518
I work in a school and we have between 700 - 1000 user profiles on a Windows 7 machine. Windows 7 seems isn't handling this amount of users well [worse than XP]. I am unable to delete user profiles via the gui method as windows simply won't respond. Now if you delete a user out of the c:\users folder the next time the user logs on they are issued a temporary profile as you also need to delete the registry key for that user as well. From a school point of view, temporary profiles are brilliant. My question is, is there a way of making every network user a temporary user?
 

My Computer

OS
7 Professional
Will adding the active directory students groups to the local GUEST group make the profiles temporary?
 

My Computer

OS
7 Professional
Tries it while waiting and this seems to work just fine. I even crashed the machine while the user was still logged on and it tidied itself up. Anyone know of any pitfalls to this?
 

My Computer

OS
7 Professional
Delprof successor for Windows 7

I have written an inofficial successor to Delprof creatively called Delprof2. It works on all versions of Windows (XP/Vista/7/2003/2008/2008 R2), is syntax-compatible to the original and even more powerful.

Delprof2 is free to use commercially or otherwise.

More information and download: Delprof2 – User Profile Deletion Tool | Helge Klein | Home of SetACL
 

My Computer

OS
Windows 7 x64
For windows7 or windows 2008 you can use delprof2 . or easier way ' you can use "Tsprofcleaner" it's a free software that make the work prefect .
 

My Computer

Computer type
PC/Desktop
OS
windows 7 64 bit
Back
Top