Solved

Deleting Profiles

Posted on 2004-09-24
5
368 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 83

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

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…
We need a new way to communicate time sensitive or critical info.   The best part of my role at xMatters is visiting our clients all over the world to learn about how they operate their businesses, share insights that xMatters has gleaned across…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

911 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now