Shell API to get Windows SID from Cygwin name?

Brian Inglis Brian.Inglis@Shaw.ca
Fri Sep 22 12:07:00 GMT 2023


On 2023-09-21 23:58, Martin Wege via Cygwin wrote:
> Does Cygwin have a shell (e.g. bash) API to lookup the Windows SID for
> a given Cygwin user or group name?
> /usr/bin/getent usersid thisisausername

Forget Windows! Think Unix:

$ getent passwd $USER	# sanitized output:
$USER:*:$UID:545:U-$HOSTNAME/$USER,S-1-5-21-...-...-...-1001:$HOME:/bin/bash

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


More information about the Cygwin mailing list