"Get-AdComputer -filter" doesnt return anything when looking for Vista Clients

Solution 1:

That T in "VistaT" is no T at all - it represents a trademark symbol: ™ (U+2122 or #8482 in Unicode)

Try this:

Get-Computers -OperatingSystem $("Windows Vista" + [char]8482 + " Business")

Why Microsoft chose to abuse the ability to store unicode symbols in string value attributes in this way is beyond me.


Here is how I found out:

(When you cast a .NET char to an integer, you'll get the byte value for ASCII chars, or a 2-byte codepoint for unicode characters)

$osString = (Get-ADComputer [VistaComputerName] -Properties operatingSystem).operatingSystem

foreach($c in $osString.ToCharArray())
{
    Write-Host $("$c: " + "$([int]$c)")
}

At this point, my output consisted of all ASCII chars (all integers a single byte), except for the T:

W: 87
i: 105
n: 110
d: 100
o: 111
w: 119
s: 115
 : 32
V: 86
i: 105
s: 115
t: 116
a: 97
T: 8482
 : 32
B: 66
u: 117
s: 115
i: 105
n: 110
e: 101
s: 115
s: 115