Question Locked

Export Computer list from Active Directory

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Does anyone know of a script to export a list of computers and their descriptions from Active Directory, and export the results to excel or a csv?

4 replies

by dumphrey

will give you the data you want in 1 short batch file.

*******bat start*****

del withDesc.txt
del nameDesc.txt
dsquery computer -name * -desc * > c:\withDesc.txt
for /F %%a in (withDesc.txt) do dsget computer %%a -dn -desc >> c:\nameDesc.txt
findstr /C:"" c:\nameDesc.txt > sorted.txt
REM where it says

by robo_dev

Just grab the whole schema with Softerra ldap browser and parse out what you need in an excel spreadsheet.

by dumphrey

(since my budget = ZERO). I have to make do with free/FOSS/built in as much as possible. I guess I could learn powershell, but I like knowing it will all be on the (windows) machine I need with no install.

Seriously, I can't even get replacement UPSs approved...

This discussion is closed to new replies.