Windows – Find built-in administrator account name and disable it

By Saad Khamis

December 14, 2022

34944 views

Introduction

We will find the built-in administrator account name, even if it was renamed, and disable it.

When Windows workstation or server is installed, the default built-in administrator account name is Administrator. Some companies rename the local built-in administrator account, as a result, instead of using the default account name, we will use the account well-known security identifier (SID). The account SID has the following format “S-1-5-domain-500″.

Commands used

Disable-LocalUserDisables a local user account.
Get-LocalUserGets local user accounts.
Get-WmiObjectGets instances of Windows Management Instrumentation (WMI) classes or information about the available classes.

Find built-in local administrator account name

Use the following command to find the account on the local system.

Find built-in local administrator account name on remote system

For a remote system or even a local system, we can use Get-WmiObject.

With PowerShell splatting:

Find built-in local administrator account name on multiple systems

Disable built-in local administrator account

To disable the account, use Disable-LocalUser.

In conclusion

In summary, we explored how to get the name of the built-in administrator account name, even if it was renamed, on a single or multiple systems. Also, how to disable the account.

Did you find this code easy to follow and helpful to you? I certainly would love to hear your feedback and suggestions. So, let me know in the comments below. Happy PowerShelling.

Disclaimer

Purpose of the code contained in blog is solely for learning and demo purposes. Author will not be held responsible for any failure or damages caused due to any other usage.

Comments

There's no comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

AWS EC2 – Get all EC2 instances in all profiles and all regions

By Saad Khamis 17350 views November 27, 2023

Windows – Get all installed patches, updates and hotfixes

By Saad Khamis 22065 views October 25, 2023

Azure – Get Storage Account Lifecycle Management Policy Rules

By Saad Khamis 35643 views October 12, 2023

Azure SQL Server: Get Azure SQL Server Firewall Rules

By Saad Khamis 36406 views August 25, 2022