Showing posts with label Convertto-Html. Show all posts
Showing posts with label Convertto-Html. Show all posts

Monday, October 29, 2012

Script to send HTML Formatted email of Newly Created Active Directory Users and Groups using Powershell.

Hi,

Sometime i love to run scripts manually and sometime  i like to schedule them.

 In our company we have lots of new joiners every week, and we also creates and use AD groups. In our IT team not everyone known about which users has just joined the company recently.

To ensure everyone in IT team knows about a new joiner in the company i have written a Tiny-Miny powershell script which is scheduled to run on every monday.

This script send a HTML formatted email containing the list of New AD Users and New AD groups those are created within a 7 days,.

You can download the script from this link : http://gallery.technet.microsoft.com/scriptcenter/Find-Active-Directory-26b71b73

Screenshot of the Output Email:
29-10-2012 16-54-31
You can download the script from this link : http://gallery.technet.microsoft.com/scriptcenter/Find-Active-Directory-26b71b73

Thanks
Aman Dhally
join aman on facebook Join aman on Linkedin follow aman on Twitter

Wednesday, September 5, 2012

Powershell and Active Directory: Get Your Active Directory Forest and Domain Information using Powershell.

Hi,

Sometime a situation comes when you want to know about your Active Directory Infrastructure.  That what is your AD Forest Name is, how many replica server do you have in your company,how many domain sites do you have  etc. etc.

When you get Answers you want to document all the above things for your future reference. Today a situation arise that i want to know answers about the above questions.

I know i can get all the answers by using Active Directory Module. But then i think if someone else need the same information, then what he will do?,he will do the same or he ask someone else in his team and waiting for their replies.

Then i think, why not to script it, so that everyone can get benefitted from it,.

So i write a simple script to done this task. Before running the script make sure you have RSAT tools installed.

Download Link: http://gallery.technet.microsoft.com/scriptcenter/Get-Active-Directory-5a51444a 

This script generates a HTML formatted Report file in your desktop folder.
That reports contain the information on :
  • Forest Name
  • Forest Mode
  • Forest Domains
  • Domain Naming Master
  • Schema Master
  • Global Catalog Servers
  • Forest Domain Sites
  • Domain Name
  • Domain NetBios Name
  • Domain Mode
  • PDC Emulator
  • InfraStructure Master
  • Replicated Servers
Screenshot of the script.
05-09-2012 15-40-18
Download Link: http://gallery.technet.microsoft.com/scriptcenter/Get-Active-Directory-5a51444a 

Thanks
Aman Dhally
join aman on facebook Join aman on Linkedin follow aman on Twitter

Thursday, October 20, 2011

Generate System Information Reports using WMI and PowerShell

 

Hi Guys,

Do you ever want to see what going on users machines? or what Settings he have on his system,?

If you have few users in your office then you can go to there desk and check it manually, but –whatif ? you have hundreds on users or you are supporting a remote users.

I just came to same problem when i want to support a remote users and he don’t know how to run “Task manager”, how to open “RUN” dialogue box so that we can run “Msconfig” to view the list of soft wares which are on system startup list , and the internet connection was very low at his end and i can’t be able to do anything remotely.

To overcome from this situation I wrote a little script which get the system info and put everything in a HTML file and when when script done it open the HTML file in Internet Explorer. Then you can ask user to send that HTML file to you by email.

This script is using “WMI” queries to find the information , using get-wmiobject command and the covert everything to HTML using “Convertto-Html” cmdlet and save the output in to a file.

 

Currently the the HTML report contains .

  1. BIOS Information
  2. Physical Disk Drives
  3. List of Network Adapters
  4. Operating System Information
  5. Logical Disk Drives
  6. IP Addresses for each Network Card
  7. List of Startup softwares
  8. Running Processes
  9. List of Services [ Whose “startup” mode is set  “Automatic” but they are currently “Stopped” for some reason]

 

you can also add more “wmi” queries in to the script. like, Battery info, CDROM Drive info, Printer info etc in to it.

I tested the script on “Windows7” and it is working perfectly.

The output of the script will be found at : C:\Users\USERNAME\Computername.html

you can download the whole script from here : http://dl.dropbox.com/u/17858935/SystemInformation.zip

Screenshot:

SystemInfo

Hope you like it

Thanks

aman dhally