[Samba] Fail to get domain SID and netbios name

RhineDevil tanyadegurechaff at disroot.org
Mon Jul 20 10:06:49 UTC 2020


Mon, 20 Jul 2020 08:15:56 +0100 Rowland penny via samba <samba at lists.samba.org>:
> On 19/07/2020 22:55, RhineDevil via samba wrote:
> > `net getlocalsid` prints "Can't fetch domain SID for name: MYMACHINE"
> > How could I solve?
> > Is there a more parsable way for getting current machine domain SID and current machine NETBIOS name?
> 
> I thought your machine was domain joined, so why do you need the local 
> machine SID ?
> 
> Having said that, 'net getlocalsid' should display the local SID and 
> 'net getdomainsid' should display the local and domain SID
> 
> If that doesn't work, try this:
> 
> wbinfo --own-domain
> 
> It should display your Netbios domain name, which you can use to get 
> your domain SID:
> 
> wbinfo -D <YOURDOMAIN> | grep 'SID' | awk '{print $NF}'
> 
> Replace <YOURDOMAIN> with the output of the first command.
> 
> If you want the computers Netbios name, that's easy, as it is the 
> computers short hostname in uppercase:
> 
> hostname -s | tr '[:lower:]' '[:upper:]'
> 
> Rowland
> 
Solved, thank you
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: Firma digitale OpenPGP
URL: <http://lists.samba.org/pipermail/samba/attachments/20200720/62991a50/attachment.sig>


More information about the samba mailing list