Solved

Deleting Profiles

Posted on 2004-09-24
5
374 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

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…
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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