Powershell Moving OU after build
MDT builds machines into dedicated OU.
Post build, PDQ inventory detects build, PDQ deploys apps based on Criteria.
What I'm looking for a is a way to move the machine into the correct OU.
I'm halfway there by getting the computername and moving it.
$newbuild = $env:computername
get-adcomputer $newbuild | Move-ADObject -TargetPath "OU=the right damn one!"
However, this relies on RSAT tools. I can do it manually by invoking a PSSession to a DC, but of course, you can't use PSsessions in scripts. Maybe I just need some more caffeine....