Need to produce a pretty report on all disabled users and their OU

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Gurus,

What I need is a script which will query my Windows Server 2003 AD for all
disabled users and I need it to tell me what OU they are in. So basically I
need two easy columns as shown below.

Account Name OU Name

Per a previous post I can output this info, using "dsquery user -disabled".
But, it returns the CN of the user as part of the complete ADSI path. So
the output looks like:

CN=Doe\, John,OU=Sales,DC=Domain,DC=COM

I can't get Excel to break the above single-line result into two columns.
Reason is their is no semi-colon separator. Example, as above, after John
there is a comma, right before OU. I really need that to be a semi-colon as
I can then easily tell Excel to use that as the column break. What I am
looking for is output like:

John.Doe Sales

Management will read this report. Is this clear as mud? :-)


.



Relevant Pages

  • Re: Need to produce a pretty report on all disabled users and their OU
    ... Script would be easier but I'm guessing that you don't have much in the way ... > I can't get Excel to break the above single-line result into two columns. ... > Reason is their is no semi-colon separator. ... > I can then easily tell Excel to use that as the column break. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Attn LoriM
    ... you have information in two columns in excel, ... click on the line under the last pasted entry (you might have to press ... switch to Word and repeat step 2 pasting the information below the other ... information (and the column break line - if you can't see this line, ...
    (microsoft.public.excel.misc)
  • RE: Import txt files into Excel
    ... Using the import text wizard select fixed width instead of space delimited, ... specified location to insert a column break. ... Allocation Code & Dept) into Excel using Data -> Import external Data ... go to step 2 of 3 I use space delimiters. ...
    (microsoft.public.excel.misc)