Thought I'd make a post that may help others. Been practicing scripting this all day. ( Mods feel free to move it somewhere better or adapt turn in to wiki whatever)
I have been panicking about cleaning up Ad and especially the profiles with taking ownership. I have managed to knock this up it seams to work but as always test it before playing on a live server.
This is taken from a mix up of a few scripts and one from Spiceworks hope that is Ok

So first we need to get a list of folders that we need to delete
Code:
$users = Get-ADUser -Filter "*" -SearchBase "OU=Class 2013,OU=Students,DC=School,DC=local" -Properties samaccountname, HomeDirectory, profilepath

$outputfile = "C:\TakeOwn\listoffolders.csv"

$users | ForEach-Object {

        add-content -Encoding ASCII -Path $outputfile -Value $_.HomeDirectory
        add-content -Encoding ASCII -Path $outputfile -Value $_.Profilepath     
          
}
This should create a listoffolders.csv that contains all the homedirectory's and Profile paths from the users in the OU in this case '2013'
Then we open up the file and add FOLDER_PATH at the top.
We then run a script from spiceworks
Code:
##==============================================================================
##==============================================================================
## SCRIPT.........: TakeOwnAndDel.ps1 
## AUTHOR.........: Stanimir Atnasov 
## EMAIL..........: 
## VERSION........: 1 
## DATE...........: 2013-11-20 
## COPYRIGHT......: 2013, Stanimir Atnasov 
## LICENSE........: 
## REQUIREMENTS...: Powershell v2.0 
## 
## DESCRIPTION....: Creates an CMD file to Take Folder Ownership, assign Administrators Full Controll and Delete Folder Tree. 
## 
## NOTES..........: Requires CSV file with 1 field - FOLDER_PATH. If there is space in foldername you have to use (""). For example: D:\foldername, "D:\folder name"
## If you have error with running script check ExecutionPolicy by typing the following at the PowerShell command prompt and then pressing ENTER: Get-ExecutionPolicy. Default is AllSigned. 
## You can change it by typing the following at the PowerShell command prompt and then pressing ENTER: Set-ExecutionPolicy Unrestricted
## You should run PowerShell with Run As Administrator as well as created output .cmd file
## If you would like just to take ownership and set permissions, simply delete third row.
## 
##CUSTOMIZE......: 
##==============================================================================
## START 
##==============================================================================
$outputfile = "C:\TakeOwn\takefolderownership.cmd"

# Assumes a CSV with one column, FOLDER_PATH. 
$folders = import-csv "C:\TakeOwn\listoffolders.csv"

$folders | %{ 
add-content -Encoding ASCII -Path $outputfile -Value "takeown /f $($_.FOLDER_PATH) /r /d y"
add-content -Encoding ASCII -Path $outputfile -Value "icacls $($_.FOLDER_PATH) /grant administrators:F /t"
add-content -Encoding ASCII -Path $outputfile -Value "RMDIR $($_.FOLDER_PATH) /S /Q"

} 
##==============================================================================
## END 
##==============================================================================
This should then produce a takefolderownership.cmd that we can run as Administrator which will delete all the folders in the csv file.
We then need to delete the users from AD

Either selecting them in the OU and deleting or using
Code:
$users = Get-ADUser -Filter "*" -SearchBase "OU=Class 2013,OU=Students,DC=School,DC=local" -Properties samaccountname, HomeDirectory, profilepath

$users | ForEach-Object {
  
      #delete user account from AD
        Remove-ADUser -Identity $_.samaccountname -Confirm:$false   
        Write-Host 'SamAccountName: '$_.samaccountname
        
}