When I run this on several laptops logged in as local admin the value comes back true. I have one laptop that when I am logged in as local admin the value comes back false. Can anyone give me ideas on where to begin to troubleshoot his issue.
You have a typo in your code. It should not work anywhere actually …
In line 3 it should be [System.Security.Principal.WindowsBuiltInRole] instead of [System.Security.Prinicipal.WindowsBuiltInRole]
Apologies on the typo. But what I am trying to understand is how come when I am logged in as local admin and I run this code the result comes back as false. Is there a way to check if user is a member of local admin and run with elevated privledges.