using System;
using System.Management;
using System.Collections;
class Tester
{
public static void Main()
{
try
{
ManagementPath path = new ManagementPath( );
path.Server = ".";
path.NamespacePath = @"root\cimv2";
path.RelativePath = @"Win32_LogicalFileSecuritySetting.Path='c:\\tmp'"; // using tmp as folder name
ManagementObject lfs = new ManagementObject(path);
// Dump all trustees (this includes owner)
foreach (ManagementBaseObject b in lfs.GetRelated())
Console.WriteLine("Trustee: {0} \t SID [{1}]", b["AccountName"], b["SID"]);
// Get the security descriptor for this object
ManagementBaseObject outParams = lfs.InvokeMethod("GetSecurityDescriptor", null, null);