Howard Goldstein
2010-03-10 22:27:01 UTC
Hi I've got a question concerning CSVDE and the output file it creates.
I was given a list of over three thousand users, I needed to get the first
and last name, samaccountname, and the office information from each account.
I may be going about this the wrong way, but I'm not a scripter so I don't
know how to do this with vbscript.
Using Excel and DSQuery, I was able to put together a file where I ran
dsquery against all of the users in the list I was given. This gave me the
full common name of each user.
Then using this list and excel, I put together a file where using CSVDE, I
was able to query AD for each user listing the above mentioned attributes as
output data.
The problem is, when I run the first query, it outputs the data to the
output file I have listed in the CSVDE query.
When I run the second query, I want to use the same output file and have it
append the information of the second user. I want to do this for all three
thousand users so when it's done, I'll have one file with all the information
for all the users.
Unfortunately, when I run the second query, the file I created in the first
query is overwritten by the information from the second query. So if I were
to run this command all the way through, it would query for three thousand
users, but it would only list the information for the last user queried.
Is there a way I can get it to append, or perhaps there is an easier way for
me to approach this?
Thanks
I was given a list of over three thousand users, I needed to get the first
and last name, samaccountname, and the office information from each account.
I may be going about this the wrong way, but I'm not a scripter so I don't
know how to do this with vbscript.
Using Excel and DSQuery, I was able to put together a file where I ran
dsquery against all of the users in the list I was given. This gave me the
full common name of each user.
Then using this list and excel, I put together a file where using CSVDE, I
was able to query AD for each user listing the above mentioned attributes as
output data.
The problem is, when I run the first query, it outputs the data to the
output file I have listed in the CSVDE query.
When I run the second query, I want to use the same output file and have it
append the information of the second user. I want to do this for all three
thousand users so when it's done, I'll have one file with all the information
for all the users.
Unfortunately, when I run the second query, the file I created in the first
query is overwritten by the information from the second query. So if I were
to run this command all the way through, it would query for three thousand
users, but it would only list the information for the last user queried.
Is there a way I can get it to append, or perhaps there is an easier way for
me to approach this?
Thanks