Being new to PowerShell scripting, I'm having trouble setting up a script to change a select group of users and then change their home folder path in AD. I need to base this on which OU they're in, so I can do a select by OU to get the users, then a "foreach" loop to change their homefolder path. I selected a sample script and its printing out the group I want just fine, but when I get to the for each loop and try to write-host the home directory, then I fail miserably. Yes I have the AD tools loaded. Heres some of the script thats working. After "get-QADUser" line, things go south quickly.
#Powershell script to change home folder
$OU = "lwsd.k12wa.org/staff/Resource Center/MIS Dept/Net Test"
get-QADUser -SearchRoot $OU | format-Table FirstName, LastName, DisplayName, HomeDirectory -auto
users$ = get-QADUser -IncludeAllProperties -SearchRoot $OU
foreach ($user in $u)