How To Get Members of a Local Group with PowerShell

Every admin dreads audit and requests for members with privileged access. Some want screen shots, others use scripts and then there are those of us who like to tinker and use PowerShell for Windows.

What the result is a script that gets the members of the local Administrators group and export it to a file.


Save and run the script and the resulting file looks like this:

Now if we wanted to go further we could add this as a quarterly run  scheduled tasks using schtasks command.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.