in reply to How to use LookupAccountSID
sub SID_text2bin { my($text) = @_; my(@Values) = split(/\-/, $text); (@Values[0] == "S") or return; return pack("CCnnnV".(@Values-3), $Values[1], @Values-3, 0, 0, $Va +lues[2], @Values[3..(@Values-1)]); } [download]