Check if user is a Local Administrator

Version: 1.5.5
Creator Name: Marcel Calef
Date Created: 2020-06-10
Date Modified: 2020-06-10
Scripting language: BAT
Download Count: 17

This script will check if the user is part of BUILTIN\Administrators, directly named This script will check if the user is a member of BUILTIN\Administrators, directly named or inherited from other local or domain groups
Tags: administrators,security,auditing

The Script

@echo off
::  NAME   : Check if user is a Local Administrator
::           This script will check if the user is a member of BUILTIN\Administrators, directly named 
::           or inherited from other local or domain groups
::  CONTEXT: User Session
::  HISTORY: 2020-06-10 Marcel Calef - initial release

:checl_localAdmin

whoami /groups | findstr "BUILTIN\Administrators">NUL
if %errorLevel% == 0 (
        echo   User is a Local Administrator.
    ) else (
        echo   No local admin rights.
    )
:: timeout 15>nul  
:: pause >nul