I have a really simple question. What is better to use? AD Module (ie. Get-ADComputer) or DirectoryServices .NET Class when trying to connect to AD and pull all computers, users, and groups from a Domain. Or does it not matter at all?
The key factors I judge on for which method to use are:
- Which method's scripts will run faster?
- Which puts less load on the network / AD
- What limitations may each method have?
I know that the AD Module is only installed default on Win Server 2008 R2 and later, so that is a down side obviously given on an older server, the module isn't installed by default. But in today's world that really shouldn't be much of a problem given there aren't a lot of environments with all servers older than 2008 R2.
All I am trying to do is extract to a .csv all User objects (and some important fields/attributes), all Computer objects, and all Group objects. So basically "searching" the AD objects and looping through each result row and then saving to a table to export to .csv.