Why does Get-Computers -OperatingSystem "Windows VistaT Business"
not return anything? It works perfectly for all the other OS types.
Function Get-Computers
{
Param($OperatingSystem)
Get-AdComputer -Filter 'OperatingSystem -eq ${OperatingSystem}' -SearchBase "OU=Departement,DC=contoso,DC=com"
}
#Get-Computers -OperatingSystem "Windows Server 2012 R2 Standard"
#Get-Computers -OperatingSystem "Windows Server 2008 R2 Standard"
#Get-Computers -OperatingSystem "Windows 7 Professional"
Get-Computers -OperatingSystem "Windows VistaT Business"
I definitly do have Vista clients and the string to look for is Windows VistaT Business
.
PS C:\> (get-adcomputer ClientA -Properties *).OperatingSystem
Windows 7 Professional
PS C:\> (get-adcomputer ClientB -Properties *).OperatingSystem
Windows VistaT Business
That
T
in "VistaT" is no T at all - it represents a trademark symbol: ™ (U+2122 or #8482 in Unicode)Try this:
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)At this point, my output consisted of all ASCII chars (all integers a single byte), except for the
T
: