I know this question was asked a long time ago, but as there is no general answer yet, so i thought i'll share my approach. There's an easy way to filter for this with a few batch commands.
for /f "skip=1delims=" %%a in (
'wmic sysaccount where "SID='S-1-1-0'" get name'
) do set "sid=%%a"&goto next
:next
The loop is necessary because the "get name" part gives the whole table with the heading so we filter for the second line. This code then stores the value of the SID according to your locale in the "sid" variable, so you only have to refer to this when you want to use it.
In this case the whole code would look like this:
for /f "skip=1delims=" %%a in (
'wmic sysaccount where "SID='S-1-1-0'" get name'
) do set "sid=%%a"&goto next
:next
netsh http add urlacl url=https://Melnibone:443/ user=%sid%
NOTE: How you filter for the second line is up to you, the real "magic" happens in this line:
wmic sysaccount where "SID='S-1-1-0'" get name