How common are single quotes (apostrophes) in Windows usernames?
That is a bit irrelevant. (Nor is it something that can be answered.)
You found that it is not only an allowed character in a Windows user name, but that people actually do assign usernames with that character.
So, if you can, please fix your broken code.
And then take into account that from AD and for modern Windows versions/applications/libraries there are surprisingly few restrictions with regards to for example the sAMAccountName
attribute:
https://social.technet.microsoft.com/wiki/contents/articles/11216.active-directory-requirements-for-creating-objects.aspx#Objects_with_sAMAccountName_Attribute
As a counter point:
Regardless of what is technically allowed and possible in Windows/AD usually organisations have implemented a much stricter naming policy for accounts. Such policies restrict usernames to provide as much (backward) compatibility as possible, because in heterogenous environments yours is not the only application that breaks on usernames that don't meet "old" conventions.
In practice that means one indeed sees mostly relatively short POSIX compliant usernames with only characters from the portable character set a-Z
, 0-9
and sometimes a hyphen -
, underscore _
or dot .
somewhere in the middle. In turn such a naming convention provides little incentive to fix/modernise those applications.