I'm trying to retrieve the domain sid for the local machine (not the machine sid). I need to be able to retrieve it without incurring network traffic to the AD server.
I found these links:
How can I retrieve a Windows Computer's SID using WMI?
And tried to GetComputerName followed by using IADsNameTranslate to convert to a sid, but when setting the name to translate I get error: 0x80072116 "Could not find the name or insufficient right to see name".
Can you point me in the right direction?
User contributions licensed under CC BY-SA 3.0