I would like to know if there is a powershell cmdlet or script that lists all High-Privileged Accounts in an Active Directory domain?
Thank you.
You have to define what you mean. Do you need a script that will list actual permissions on any object in AD?
Or membership of builtin groups like enterprise admins or domain admins?
"High-Priviliged Accounts" are generally considered to be those accounts that belong to an AdminSDHolder group.
This command:
Get-ADUser -Filter {admincount -ne '0'}
will return the users that have had their admincount property incremented by having been added to one of these groups.
You can read more about AdminSDHolder here:
https://technet.microsoft.com/en-us/magazine/2009.09.sdadminholder.aspx
Thank you.
Is their a way to redirected the command's output to a .csv file, to get the result in a table.
You do that like this:
Get-ADUser -Filter {admincount -ne '0'} | Export-CSV c:\somedir\somefilename.csv
That's very basic Powershell usage that would be covered in any Powershell tutorial.
We're here to help people learn Powershell, but they need to put forth some effort themselves. We can't just write scripts for you.