可使用以下指令实现
Get-ADUser -filter * -SearchBase "DN" -SearchScope Base|OneLevel|Subtree |Set-ADUser -LogonWorkstations ***
请注意SearchScope 的三个参数值分别代表不同检索范围,如以下描述,请根据实际需要选择
A Base query searches only the current path or object.
A OneLevel query searches the immediate children of that path or object.
A Subtree query searches the current path or object and all children of that path or object.