I want to convert SID string format to bytes array representation which in turn will be supplied to LookupAccountSid()
method's second argument in C#. But I don't find any particular in built function which can do this. For example:
SID = S-1-5-32-544
can be converted into:
(SID: 1,2,0,0,0,0,0,5,32,0,0,0,32,2,0,0)
I saw it in some posts. but how?
Is there a easy way to achieve this? Basically I want the byte array representation of the NT Authority\NetworkService
which is SID = S-1-5-20
. Thanks in advance for your help.
LookupAccountSid()
your code, or a built in function? – Batchelder