Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Active Directory reportig script

I am opening this thread because a lot of you are sending me questions related with script's features and results export.
Topic is related with this article at

It is better to discuss this on forum instead of sending e-mails or put comments below article. Other people can check if someone asked similar question.

Please feel free to update this thread and I hope we will make the script better!
Below you can find commonly asked questions with answers
Quote:Why is the script in a doc? Just strange is all..

When I started my blog it was stored on official where many of file extensions are not allowed to be uploaded. PS1 and ZIP files are on that list, so I could not upload them in the original form. I found out that Microsoft Word (.DOC) extension is allowed, and I renamed file by adding .DOC at the end. In fact this is still plain PS1 text file (PowerShell code).

Just simply download it, rename as ADReport.ps1 and execute in PowerShell console. It will work.

Now I'm migrating blog from to other hosting where I can freely manage the blog and when I finish migration, it will be available with PS1 extension, for sure.
Quote:this is really nice. One question though, can we output this info to a file

Quote:Thanks for writing this beautiful script, i am using this, but i want to get this information in email or i want to get Html report from this script, can you help me how can i achieve this.

Quote:How can I output to a text file? The normal methods does not seem to work. I did | Export-csv -path c:\temp\output.txt

Quote:Excellent script, tired of taking screenshots :-) is there a way to export report to txt format?

Quote:The script is really useful, but how can I export the output of the command powershell in an html file?

A script is still under features development.
Unfortunately, at this stage the script doesn’t offer exporting results to HTML,CSV or TXT files. You can only manually select text from output in PowerShell console and copy it to notepad or take screen shots.

When I have started writing this script, it contained few simple checks. I was adding new features day by day and I discovered that the script grown too much. At this stage I decided to share the code for others as it may be helpful. I did not think about exporting data to file but after some time of using it, I figured out that this option might be useful.

As I said before, the scrupt is still under development, so some they it will be supporting data export.

Another story about the script is Daniel Petri :] He contacted me and asked if we can add some more Active Directory checks into it. Of course we agreed and started to extending tool for more checks. At the end we received huge code which does not support PowerShell objects. They are not implemented inside the code yet.

There are no PowerShell objects defined to capture results and that’s why mentioned above file formats are not possible to use. To allow that, the script needs to be completely rewritten.

I’m wondering if it’s better to start writing new one based on PowerShell 3.0/4.0 (Windows Server 2012/2012R2) or redesign the current one. Will let you know about decisions.
I believe that I have a script (based on your original) that
1. Places all AD queries into functions. These functions all return PSCustomObjects so that you could pipe them into export-csv, out-grid, or (in my case) convert them to HTML.
2. Puts all the calling code into regions
3. Uses Don Jones EnhancedHTML2 module to convert to HTML

I made some changes to the underlying logic (for example I get a list of all the operating systems in use in the domain and base my "how many of these do I have" region on those - this way I don't have to go back and add new operating system names as they are released). For the most part though it is based on your original so if you are interested I will be happy to share with you and your members. I'm sure that with all the talented Powershell users out there folks can improve upon what I've done.
Wonderful! That would be great if you could share the code with us.

Can you tell me please how can you share the script? I will create new post on my blog with full credits for you!
Do you have an email address I can send it to? I don't see any way to 'Post' it on your site...
Quote:Do you have an email address I can send it to?

Sure, feel free to send it to blog dot kpytko at gmail dot com

Thank you in advance!

Forum Jump:

Users browsing this thread: 1 Guest(s)