+ Post New Thread
Results 1 to 2 of 2
Windows Server 2008 R2 Thread, Delete old home directories for removed users. in Technical; Hi, We have lots of folders in our home directory directory that are no longer linked to existing accounts. I've ...
  1. #1

    Join Date
    Nov 2011
    Posts
    607
    Thank Post
    84
    Thanked 21 Times in 19 Posts
    Rep Power
    10

    Delete old home directories for removed users.

    Hi,

    We have lots of folders in our home directory directory that are no longer linked to existing accounts.

    I've tried to find a script but they all seem to be for linux.

    Is there a way/script to delete these.

    The home folder names are identical to their usernames.

    Thanks

  2. #2

    Gatt's Avatar
    Join Date
    Jan 2006
    Posts
    6,644
    Thank Post
    858
    Thanked 645 Times in 428 Posts
    Rep Power
    498
    If your Home Folders are based on usernames, then a PowerShell script to read in all the folders to a CSV files, and then run the CSV against all usernames in AD, and delete the folder if $samaccountname doesn't exist

    You'd need to play with the powershell code to compare the folder name and samaccountname...

  3. Thanks to Gatt from:

    dany2010 (16th July 2013)

SHARE:
+ Post New Thread

Similar Threads

  1. Home folders for AD users
    By kevrage in forum Mac
    Replies: 0
    Last Post: 13th June 2013, 11:35 AM
  2. cant access home folder for one user
    By One_Minute_Hero in forum General Chat
    Replies: 6
    Last Post: 14th January 2013, 03:44 PM
  3. Replies: 7
    Last Post: 13th June 2012, 02:19 PM
  4. Replies: 3
    Last Post: 15th February 2008, 12:58 PM
  5. Replies: 7
    Last Post: 21st August 2007, 01:11 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •