2

When running the net user username /domain command in cmd, all the dates (Password last set, Password expires, Password changeable and Last logon) have a strange character before the individual dates numbers, like:

Password last set      ⌠2019-⌠11-⌠27 09:22:20

When I copy and convert that character to HEX, I get E2808E (the 'LEFT-TO-RIGHT MARK' U+200E Unicode character).

What is causing this? I'm guessing it's a setting on the Active Directory server?

I'm extracting the value in a batch file:

for /f "tokens=3,4 delims= " %%f in ('net user %username% /domain ^| find /I "Password expires"') do set expire=%%f %%g
set "expireDate=%expire: =" & set "dummy=%"
echo %expireDate%

And I get:

?2019-?11-?27
Goozak
  • 121
  • 4
  • 1
    I've actually been wondering about this, too. It's not Active Directory-related. It occurs with local accounts on non-Domain-joined machines, too. I've only seen this behavior on Windows 10 / Windows Server 2016 computers. I don't see it with Windows Server 2012 or 2012 R2 or earlier OS's. It occurs whether I'm using the new console or legacy console on Windows 10. – Evan Anderson Dec 04 '19 at 22:50
  • find.exe does not understand Unicode and shows ? (as a common string replacement character) instead. Hence, you can use %expireDate:?=% to get a valid date… – JosefZ Dec 05 '19 at 00:39
  • Yeah @JosefZ, that's what I'm using to clean it, but I'm curious about the source of the 'issue'. – Goozak Dec 06 '19 at 15:57
  • 1
    Looks like a bug in net.exe. Those Left-To-Right Mark characters appear in all dates in net.exe output e.g. NET STATISTICS Workstation, NET TIME etc. Maybe an user with experience in right-to-left writing system (ANSI 1255-Hebrew or ANSI 1256-Arabic) could know more? – JosefZ Dec 06 '19 at 19:50

0 Answers0