locked
Add Computers to Log On Workstation Attribute (userWorkstations) based on computers in OU. RRS feed

  • Question

  • 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.





    • Edited by Dave Zuver Thursday, April 11, 2019 11:57 PM
    • Moved by Bill_Stewart Wednesday, September 4, 2019 9:15 PM Abandoned
    Thursday, April 11, 2019 11:53 PM

All replies