Solved

Deleting Profiles

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

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…
Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

17 Experts available now in Live!

Get 1:1 Help Now