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

8 comments:

  1. what if i want to run this for multiple computers and create a report? can we do that?

    ReplyDelete
    Replies
    1. Hi Zia,
      Sorry this script is not supporting Multiple Severs.

      thanks
      aman

      Delete
  2. This is some great stuff, ty for inspiration

    ReplyDelete
    Replies
    1. Thanks Joe,

      I am glad that you like it,

      thanks
      aman

      Delete
  3. Hi Mr. Aman,
    was just wondering, in your script, the running process portion, what does the VM(MB) and WS(MB) stands for?

    ReplyDelete
    Replies
    1. Hi Nicholas

      VM = Virtual memory
      WS = Working set :)

      regards
      aman

      Delete
    2. Thanks a lot!
      Cheers!! (:

      Delete
  4. Thank you for the release.

    I needed the list of software installed......Get-WmiObject win32_product | select Name,Version | ConvertTo-html -head $a -Body >> "$filepath\$vComputerName.html"

    ReplyDelete

Note: Only a member of this blog may post a comment.