Twhite0909
asked on
Run a Active Directory Admin query
In AD Powershell how can I pull a report to show me all ADMINs in AD and export to csv?
Thanks in advance.
Thanks in advance.
What kind of administrators are you looking at? And what is the version 2003 or 2008?
ASKER
AD 2008 and I basically want to find any user account with any type of admin a cess besides local admin
Hi,
This will pull you the groups and members of administrator and child group or user if any...
get-adgroupmember -Identity administrators -recursive
To export to csv
Regards,
Prem
This will pull you the groups and members of administrator and child group or user if any...
get-adgroupmember -Identity administrators -recursive
To export to csv
get-adgroupmember -Identity administrators -recursive | export-csv c:\temp\admin_members.csv
Regards,
Prem
ASKER
It says completed successfully but in RED so looks like an error also it exported the file but it is 0KB.
Here is the syntax I got after the cmd ran
Get-ADGroupMember : The operation completed successfully
At line:1 char:18
+ get-adgroupmember <<<< -Identity administrators -recursive | export-csv c:
\temp\admin_members.csv
+ CategoryInfo : NotSpecified: (administrators:ADGroup) [Get-ADGr
oupMember], ADException
+ FullyQualifiedErrorId : The operation completed successfully,Microsoft.A
ctiveDirectory.Management. Commands.G etADGroupM ember
Here is the syntax I got after the cmd ran
Get-ADGroupMember : The operation completed successfully
At line:1 char:18
+ get-adgroupmember <<<< -Identity administrators -recursive | export-csv c:
\temp\admin_members.csv
+ CategoryInfo : NotSpecified: (administrators:ADGroup) [Get-ADGr
oupMember], ADException
+ FullyQualifiedErrorId : The operation completed successfully,Microsoft.A
ctiveDirectory.Management.
That command should work for you. Check the permissions of the user you're running under.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 500 points for Subsun's comment #a38855393
Assisted answer: 0 points for Twhite0909's comment #a38844276
for the following reason:
Answer was received from another source
Accepted answer: 500 points for Subsun's comment #a38855393
Assisted answer: 0 points for Twhite0909's comment #a38844276
for the following reason:
Answer was received from another source