I need a script that will look at a specific OU, grab the computer object names and add those names into the userWorkstation Attribute for the user I specify.
I have this which gives me the computer names:
$computer =dsquery computer "OU=Checkout-Presentation,OU=Workspace,DC=DWT,DC=com" -o rdn
Set-ADUser -Identity SA_ZuveDHD -LogonWorkstations $computer
I'm pretty sure I need some sort of foreach statement but I can't quite wrap my head around how to get this done. Any help appreciated.