If you want this to be done in Powershell, please let me know and i will assist.
Will.
ivan rosa
ASKER
Deroode,
pretty close..., for your first, I created this one line script, which pretty much does what I need but I don't know how to split the result into the two columns
for /f "tokens=1" %a in (computerlist.txt) DO dsquery computer -name %a>>output.csv
so this is what CSV would look like e.g.
CN=WORKSTATION1,OU=Computers,OU=Marketing,OU=Hollywood,OU=USA,DC=corp,DC=acme,DC=com
do you know how to split the result csv like so?
Column A Column B
cn=workstation1 OU=Computers,OU=Marketing,OU=Hollywood,OU=USA,DC=corp,DC=acme,DC=com
I wouldn't know how to do that; mainly because the output of de dsquery command is in fact a comma separated list, and for the csv file you actually want the first name, a comma, and then the rest of the line in quotes so the result is:
Maybe with some tricks you could do that in one line, but i guess that would become quite unreadable. My script does the job and is pretty straightforward....
ivan rosa
ASKER
This has actually helped me to combine my script with the above
Open in new window
Deleting is done with dsrm:
Open in new window
As always, first test !