I Found this Code , It returns true If User is admin else false
befor using it add Refrence
System.DirectoryServices.AccountManagement
public bool IsAdmin ()
{
try
{
var userCurrent = System.DirectoryServices.AccountManagement.UserPrincipal.Current;
var Groups = userCurrent.GetAuthorizationGroups();
var IsPotentialAdmin = Groups.Any(p => p.Sid == new SecurityIdentifier("S-1-5-32-544"));
return IsPotentialAdmin;
}
catch (Exception ex)
{
return false;
}
}