Wednesday, August 27, 2008

[THIN] RemProf with Exclude option

FYI
Jim Kenzig
Blog: http://www.techblink.com

Hi All

 

A few weeks back while trolling the lists and forums, I saw a question from a member regarding a tool for deleting all profiles with exclusions. The question was from the thin lists as detailed below:

 

Hi

We are removing roaming profiles from our organisation as we don't really need them anymore.  We will use local profiles only on Windows 2003 systems.  I want to setup a scheduled task on each server that deletes all local profiles except Administrator, All Users and Default User.  AD Group Policy only has a setting to delete cached roaming profiles, not local profiles.

I know there are utilities such as delprof and remprof but I dont believe there is an easy way to say delete all except Administrator etc.  Has anyone achieved this or know of an easy way to do this?

Thanks
Angela

 

Well the good news is that I thought I'd modify REMPROF to include an EXCLUDE: option to allow an administrator to delete profiles based on age excluding specific accounts. Download it from http://www.ctrl-alt-del.com.au/CAD_TSUtils.htm

 

 

Usage:

REMPROF [/LIST|username|/A|/D:days|/AD:days] [/EXCLUDE:usernames] [/?]

 

  /LIST    - List all user profiles currently not in use (Default).

  username - Delete user profile based on username.

  /A       - Delete all user profiles that have no username association

             i.e. The username has been deleted in Active Directory but

             a profile still exists in form of a SID.

  /D:days  - Delete all user profiles equal to or older than the number of

             days specified. NB: /D: without a number is equal to /D:0.

             /D:0 will remove CURRENT user profiles not in use.

  /AD:days - Delete all user profiles that have no username association

             and are equal to or older than the number of days specified.

             NB: /AD: without a number is equal to /AD:0.

  /EXCLUDE:username/s - Exclude particular users from being deleted.

                        Can accept multiple entries, seperated by comma.

                        Must be last command line argument.

                        Unassociated profiles cannot be excluded.

                        Do not include the Domain Name.

  /?       - show this help file

 

REMPROF without parameters will execute the /LIST switch by default.

 

E.G. REMPROF /D:10 /EXCLUDE:bob,mary

This command will delete any profile equal or older than 10 days, excluding

any profile whose username is bob or mary.

 

I hope this is useful.

 

Kind Regards

 

Warren Simondson

Ctrl-Alt-Del IT Consultancy Pty Ltd

Website: http://www.ctrl-alt-del.com.au


No comments: