I can get isinrole to work for domain groups and local groups but it
always returns false for local groups on remote machines. Is there
something I'm missing? The code I am using is below.

            var wi = WindowsIdentity.GetCurrent();
            var wp = new WindowsPrincipal((WindowsIdentity)wi);
            var test = wp.Identity.Name; //retrieves the correct name
            var test2 = wp.IsInRole("DOMAIN\group1"); //correctly
returns true
            var test3 = wp.IsInRole("group2"); //correctly returns
true for local groups
            var test4 = wp.IsInRole("MACHINENAME\group3"); //always
returns false

Reply via email to