Formatting DSquery | dsget file

Joined
Jun 7, 2011
Messages
5
Reaction score
0
Hello,

I am trying to pull all of the users information from AD that contain a phone number.

The problem is that it returns all users information and simply includes the -tel line so most of the users do not have anything present in that line. We also returned all of the disabled account information so I added the -disabled command which adds a "yes" (disabled)or "no" (active) to each account. There are a lot of blank rows as well.

I have been able to export the inforamtion into an .xls file with a batch file. The syntax looks something like this:

dsquery user -name * -limit 2000 | dsget user -ln -fn -tel -dept -disabled > C:\userslist.xls


I've been able to Delete the information I need to get rid of by creating macros but have had no luck getting all of the functions to run together in an automated process. I have not been able to get any macros to fire from the batch file.

We need to perform this task often so all of the required actions should be performed with a single click.

Can anyone help me clean up the information that is being returned?

Please help!
 
Joined
Jun 7, 2011
Messages
5
Reaction score
0
Keep in mind that the file does not have to be in excel. I just need a cleaned up version of what is returned from the above syntax.

Essentially just users who have a phone number and whos account is still active.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top