Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


December 2005

The Easy Way to Delete Unused Profiles

RSS
Subscribe to Windows IT Pro | See More Tips Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

In my domain, we use local profiles rather than roaming profiles. However, from time to time, people log on to other workstations besides their own for various reasons. Until recently, I manually checked each workstation for unnecessary profiles stored locally, but finally I discovered the Delprof utility. I can execute Delprof remotely and ask it to remove from all our computers all profiles that have been unused for the past 90 days. Note that Delprof will even delete Administrator profiles, so you need to be careful when using it.

You can find Delprof in the various Windows resource kits. You can also download it from the Microsoft Download Center. (Go to http:// www.microsoft.com/downloads, and search on delprof.exe.) Delprof's syntax is simple. For example, the command

Delprof.exe /I /Q /C:\\pc1 /D:90 

tells Delprof to delete all the profiles that haven't been used in the past 90 days from the computer named PC1. The /I switch tells Delprof to ignore errors. The /Q switch tells the utility to delete profiles without confirmation. The /Q switch is important to include if you plan to automate the deletion process. When you don't include this switch, you must confirm that you want to delete each profile before Delprof will delete it.

To automate the deletion process, you can create a simple text file named computers.txt that contains all the names of the computers in your network. You need to put each name on a separate line. After you've created this file, run the following For command from the command-shell window:

For /f %a in (computers.txt) Do 
  Delprof.exe /I /Q /C:\\%a /D:90 

Delprof will then delete all the profiles that haven't been used in the past 90 days from the computers specified in the text file.

Alternatively, you can place the For command in a batch file, which you can then schedule to run periodically. Note that you must replace the two occurrences of %a with %%a to use this command inside a batch file. (When you use an iterator variable in a For command that you execute from a command prompt, you use one percent sign. When you use an iterator variable in a For command in a batch file, you must use a double percent sign.)

End of Article



Reader Comments
Hi, when I run this program I recieve this error message, do you know what it means. "Failed to retrieve the profile path for"

mrg68 March 13, 2006 (Article Rating: )


This article has two large errors with it.
The syntax for the "for in do" is wrong, it all needs to be on one line, NOT 2 as shown, or else you receive a syntax error message.

When I run the "for in do" from command prompt or in a batch file, after each computer listed in computer.txt I am asked if I want to delete the profiles off the local system that I ran the "for in do" from.

marcfromm July 20, 2006 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

The Memory-Optimization Hoax

Don't believe the hype. At best, RAM optimizers have no effect. At worst, they seriously degrade performance. ...

More fun TechEd 2005 Resources

Kevin points out some more TechEd resources ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Are You Satisfied?

A Preliminary Look at Deployment Plans for Microsoft Windows Vista

Related Events Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

IT Connections
Dive into the new Microsoft platforms and products you implement and support with the experts from Microsoft, TechNet Magazine, Windows ITPro and industry gurus. There are 70+ sessions and interactive panels with networking opportunities.

Attention User Group Leaders...
Announcing the eNews Generator—a FREE HTML e-newsletter builder for user group leaders. Build your HTML and text e-newsletters in minutes and add Windows IT Pro & SQL Server Mag articles alongside your own message!.

Master SharePoint with 3 eLearning Seminars
Learn how to build a better SharePoint infrastructure and enable powerful collaboration with MVPs Dan Holme and Michael Noel. Register today!

Get SQL Server 2008 at WinConnections
Don’t miss Microsoft Exchange and Windows Connections conferences, the premier events for Microsoft IT Professionals in Las Vegas, November 10-13. Every attendee will receive a copy of SQL Server 2008 Standard Edition with one CAL.



Interested in Email Encryption?
Read about the advantages of identity-based encryption in this free report.

Order Your SQL Fundamentals CD Today!
Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD.

25% OFF Email Archiving Solution
Try the leading email archiving solution: GFI MailArchiver 6.

Virtualization Congress Oct. 14-16 in London
Don't miss Virtualization Congress, the premiere EMEA conference dedicated to hardware, OS and application virtualization. Oct. 14-16.
Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technical Resources Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing