Exporting users that are part of local administrator group of each joined to domain server?

Abdulrahman 101 Reputation points
2023-09-26T08:22:40.1+00:00

Hi Everyone!

I'm searching for a way to export all local administrator members in each joined to domain server.

Any recommended way either a powershell or cmd etc..

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,917 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,425 questions
{count} votes

2 answers

Sort by: Most helpful
  1. anza 836 Reputation points
    2023-09-26T11:12:53.2133333+00:00
    1. Are you looking for members of local domain group of Administrators
      In that case you can use the following powershell on a DC:
      Get-ADGroup Administrators | Get-ADGroupMember | Get-ADObject | Select-Object Name, ObjectClass
    2. Are you looking for members of local group administrators on a domain controller?
      When a windows server is promoted into a domain controller, the built-in local groups and local accounts get deleted and do not exist.
      https://learn.microsoft.com/en-us/windows/win32/secmgmt/built-in-and-account-domains#computers-that-are-domain-controllers
    3. If you are looking for members of local group administrators on a member/standalone server you can check local administrators group members via following powershell
      https://learn.microsoft.com/en-us/windows/win32/secmgmt/built-in-and-account-domains#computers-that-are-not-domain-controllers
      Get-LocalGroup Administrators | Get-LocalGroupMember

    Regards

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.