Ask Your Question
2

What is the PowerShell script used to retrieve administrators on computers and servers?

asked 2022-11-11 11:00:00 +0000

nofretete gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-12-03 23:00:00 +0000

scrum gravatar image

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"
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-11-11 11:00:00 +0000

Seen: 8 times

Last updated: Dec 03 '22