我正在尝试浏览Active Directory,并抓住符合特定条件的用户.我想让用户拥有Manager A或Manager B,但我不确定如何实现or语句.这是我的代码:
Get-ADUser -Filter * -Properties country, extensionattribute9 | if (extensionattribute9 -eq 'Smith, Joe') or (extensionattribute9 -eq 'Doe, John') {select extensionsattribute9, country}
Run Code Online (Sandbox Code Playgroud)
在此代码中,它无法识别extensionattribute9,它为您提供了用户的管理员.
我也试过尝试使用where而不是if,但无济于事.
powershell ×1