1 | initial version |
The PowerShell script used to retrieve administrators on computers and servers is:
Get-LocalGroupMember -Group "Administrators"
This command will return a list of all members of the "Administrators" group on the local computer or server. This includes both local and domain administrators. If you want to target a remote computer or server, you can add the "-ComputerName" parameter followed by the name of the target computer. For example:
Get-LocalGroupMember -Group "Administrators" -ComputerName "RemoteComputerName"