FN-GM Posted October 22, 2018 Posted October 22, 2018 Hello, We have inherited a network. I think there are home folders for accounts that no longer exist. Does anyone have a quick method to identify these please? Thanks
sted Posted October 22, 2018 Posted October 22, 2018 just search for files that havent been accessed in a year or more?
sister_annex Posted October 22, 2018 Posted October 22, 2018 do your current user folders match usernames?
LukeRowberry Posted October 22, 2018 Posted October 22, 2018 Give this a go: https://www.jaapbrasser.com/new-script-find-orphaned-home-folders/
3s-gtech Posted October 22, 2018 Posted October 22, 2018 Add the Owner column to explorer. If the account has been deleted, it'll just show the SID of the account instead of the username. If they're not ownership linked to usernames, you can bulk link them with chown (that's how I do it anyway) which is useful for quotas/FSRM etc.
ozydave Posted October 24, 2018 Posted October 24, 2018 G'Day Ive used the below to check the homedrive folders against AD which then outputs to a txt file. I did then have another powershell script that reads the text file and deletes the folders, i cant find this at the moment as i am away. i'll have a look next week when im back. Hope this helps for now --------------------------------------------- $student = Get-ChildItem **folder to check goes here** foreach ($stu in $student) { #Write-Host $stu try { get-aduser "$stu" -Properties * |select enabled,name,samaccountname } Catch {write-Host User $stu was not found in Active Directory ... -ForegroundColor red $stu>>c:\NotInAD.txt } } -----------------------------------
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now