Question : How to convert to byte[]

                      SecurityIdentifier si = new SecurityIdentifier
                            ((byte[])adSrcFound[index].Properties["objectSid"], 0);
Error
Error      1      Cannot convert type 'System.DirectoryServices.ResultPropertyValueCollection' to 'byte[]'      

Answer : How to convert to byte[]

You need to index into the ResultPropertyValueCollection:
(byte[])(adSrcFound[index].Properties["objectSid"][0])
Random Solutions  
 
programming4us programming4us