if ((gwmi Win32_ComputerSystem).PartOfDomain) {
  $admins = net localgroup Administrators
  $global = @()
  $local = @()

  $i = 7
  while ($i -lt $admins.Length - 2) {
    if ($admins[$i].Contains('\')) {
      $u = $admins[$i].Split('\')[1]
      $i++
      if ($u -eq 'Domain Admins' -or $u -eq 'Enterprise Admins') {
	continue
      }
      $global += $u
    } else {
      $local += $admins[$i]
      $i++
    }
  }

  foreach ($a in $global) {
    if ($local.Contains($a)) {
      "$a should be removed from (local) Administrators group."
    }
  }

  ''

  foreach ($a in $local) {
    $a
  }
  if ($local.Length -ne 0) {
    if ($local.Length -ne 1) {
      '-> These accounts should be inactive.'
    } else {
      '-> This account should be inactive.'
    }
  }
}
