This has good applications in a school or college where you have cohorts moving up a year. It also is useful for enterprise where a department has been renamed.
$Mailboxes = get-user -Filter {Department -like "Year 11"} $Mailboxes | ForEach-Object { set-user -Identity $_.Identity -Department "Year 12" }
Remember to first delete all your Year 12 (aka. leavers) before running the script otherwise it will become complicated very quickly with merged year 12 from year 11 and year 12 who have left.