List local Windows Administator names with PowerShell

List local Windows Administator names with PowerShell

To list the local administator accounts, you can just use the group membership command Get-LocalGroupMember -Group "Administrators" Object

List local Windows Administator names with .NET

List local Windows Administator names with .NET

First, you need to install the NuGet Package System.DirectoryServices.AccountManagement Now you can open a context and get all members of the built-i