title: Check if user is a member of the local admins group on a remote server
body: <p>The user is a member of the AD security group "Domain\Sql Admins", and the security group "Domain\Sql Admins" is a member of the local <strong>Administrators</strong> group on a Windows Server.</p>
  
  <p>I have tried the following PowerShell script:</p>
  
  <pre><code> $u = "Username"; net localgroup administrators | Where {$_ -match $u}
  </code></pre>
  
  <p>This script will only return the user if it is added directly to the admin group. Do I have to cycle through all of the groups in the admin group until I find my user? Or is there another way?</p>