internal static byte[] ToBytes(this SecurityIdentifier Sid) { var sidBytes = new byte[Sid.BinaryLength]; Sid.GetBinaryForm(sidBytes, 0); return sidBytes; }