Thank you everyone for you download and support! Your support was the main motivation for me to enhance this function. Please make sure to vote my script, if you find it useful. For a complete guide regarding this function, you can refer to this post:

How to get local admins of computers in your AD domain?

This script uses Powershell to query members of Local Administrators group on every machine or your selected machines. The script may take quite time depending on your size of Active Directory and number of computer accounts in your domain. The script simply uses ADSI and collect all of the members in Local Administrators group and output them to a CSV file.

If you want to understand how does this function performs, please feel free to browse to the link I provided at top (the yellow text). Otherwise you can run the script with following methods:

All Computers in domain:
PS:> Get-LocalAdminToCsv


All computers in an OU:
PS:> Get-LocalAdminToCsv -Path "OU=Test,DC=Test,DC=Com"


A single Computer
PS:> Get-LocalAdminToCsv -ComputerName PC1


A couple of screenshot from this function:


Image 1: Dot-Sourcing the Function.


Image 2: Query in progress.


Image 3: Result in CSV.