2

I am working on trying to dump all asset information (with a focus on servers) from active directory on Windows 10. Currently, the main tool that has been working for me is 'Get-ADComputer' using powershell.

As an example:

Get-ADComputer -Filter * -Property * | Select-Object Name,DNSHostName,OperatingSystem,OperatingSystemServicePack,IPv4Address,LastLogonDate | Export-CSV All-Windows.csv -NoTypeInformation -Encoding UTF8

However, I feel like it is missing somethings or does not do a good job covering all assets like Linux machines that are configured within AD. I tried to install a tool called powersploit but the security permissions on my machine were really fighting me. Also, another ideal capability would be to try and dump assets from other AD environments that have trust relationships with my local AD environment but the priority is the first item.

Perhaps some AD gurus can provide me some advice.

Thanks, Joe

1
Get-ADComputer -Filter * -Property *

That command returns every computer object there is in your domain. If you're missing Linux computers, then they are not authenticating towards the domain using a computer account, but maybe a user account. Or not at all.

4
  • With the caveat that the user running the command has permissions (and PowerShell elevated if necessary) to see all those computer objects in AD. Any user should be able to see them by default, but who knows what OU permissions have been applied. – Ryan Bolger Aug 19 '20 at 21:04
  • You're right. But if there are no deny permissions on the ACL and inheritance has not been disabled, any AD user account is able to retrieve all AD computers. PowerShell does never need to be elevated for Get-ADComputer to work properly. – Daniel Aug 20 '20 at 9:09
  • Hello, I really appreciate your help. I ran the above command and piped it to (Export-CSV ad-dump-all-devices.csv -NoTypeInformation -Encoding UTF8) which does output lots of results but I am getting very few Linux servers and I know we have more that are bound to AD. The command does result in an error at the end but I think it might be related to the CSV output file Get-ADComputer : The server has returned the following error: invalid enumeration context. At line:1 char:1 + Get-ADComputer -Filter * -Property * | Export-CSV ad-dump-all-devices Is there anything else maybe I could try? – djoemart Sep 4 '20 at 14:00
  • 1
    I am getting very few Linux servers and I know we have more that are bound to AD. Then they are not using a computer account to authenticate towards your AD. Or the linux computers don't authenticate towards AD and you're confusing something. In any way, this is a Questions & Answers website. Helping you with troubleshooting is a little out of scope on this website. And my answer is technically correct, so please consider marking the reply as an answer. – Daniel Sep 4 '20 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.