Solved

Deleting Profiles

Posted on 2004-09-24
5
373 Views
Last Modified: 2010-04-14
Is there a way to delete a users profile after they log off the system?
0
Comment
Question by:JoshDale
  • 2
  • 2
5 Comments
 
LVL 2

Expert Comment

by:vivekpara
ID: 12148320
You could write a WSH script or batch file to delete their profile on logoff...this is dangerous as the system synchronizes profiles if you are using roaming profiles.

An example of a Batch File that would work is:

c:
cd c:\Documents and Settings\
deltree %username%

You can either use Group Policy and put it in to the Computer's Logoff script or you could create a local policy for the computer using the MMC Local Policy editor and insert it in ITS Logoff script.
0
 
LVL 2

Expert Comment

by:vivekpara
ID: 12148327
deltree %username%

should be changed to

rmdir %username% /s
0
 

Author Comment

by:JoshDale
ID: 12148591
Well, does the batch file run before or after the files are sync'd with the fileserver?
0
 
LVL 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 12150235
Assuming that you're using roaming profiles, there's a group (or local) policy you can use for that; you'll find it under Computer Configuration\Administrative Templates\System\Login, "Delete locally stored copies of roaming profiles" (or similar, not using an English version).

vivekpara's suggestion won't really work. During the user's logoff, his profile is still active. Parts of the folder will be deleted, other parts won't, because the files are still open. In addition, the user's profile does *NOT* reside at C:\Documents and settings\%username%; there are several possibilities as to how a profile folder's name can differ from the user's name. The correct path to the user profile is stored in %Userprofile%.
Using this script during the machine's shut down won't get you anywhere either. %Username% isn't even defined, and %Userprofile% points to the default user profile.

If you're not using roaming profiles, and simply want to not keep the profiles of the users, you can use a mandatory profile.
HOW TO: Assign a Mandatory User Profile in Windows 2000
http://support.microsoft.com/?kbid=323368
0
 

Author Comment

by:JoshDale
ID: 12152311
Good call, I missed that option when I was setting up their OU Group Policy. I checked it on so it should work now, thanks.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question