我试图找到姓名但转换非英语变音符号AD用户英语迹象功能里面哪里,宾语从句
例。转换Ł
到L
等
所以我写了:
Get-ADUser -Filter * -Properties GivenName, Surname | Where-Object {
[Text.Encoding]::ASCII.GetString([Text.Encoding]::GetEncoding("Cyrillic").GetBytes($_.GivenName)) -eq $name
}
它的工作很好,但我得到了一个错误:
Exception calling "GetBytes" with "1" argument(s): "Array cannot be null."
不PowerShell的不喜欢的where子句中的功能?
是否所有的用户都有'GivenName'非空? – PetSerAl
@PetSerAl不,因为它仍然返回一个有效的结果(在这种情况下为1个用户) – Fr33c3l