Report into MS Word

Version 3

    Firstly, I wanted you to know that I only started with PowerShell around a month ago when I saw the cool things you were doing with the beta of the VI toolkit, so not only have I been learning the toolkit but also PowerShell, this will hopefully excuse the basics of my code and I am sure that the experts will find a better (and faster) way of doing it ! 





    You have convinced your IT Manager that VI3 is the best virtualisation product compared to the others out there on the market (that was the easy bit). You have told him how much money you will save him and how environmentally friendly his server room will now be.  He has dusted off his corporate wallet and agreed to pay for.





    Your "pointy haired" IT Manager has asked for a weekly report of what is virtualised and an overall status of what is happening in this new wonderful system, whilst you are working 24hr shifts just to get the downtime for servers whilst your users sleep you do not have time to keep creating reports.....Enter my script !









    You could send him a bunch of html emails and csv outputs but your manager would only need help importing them and help understanding what each file is.  This script not only outputs all the results straight to MS Word but also adds nice colourful graphs and pie charts (which we all know makes managers happy).  The script can be easily added too, to enable further output utilising the functions.





    It can also email the results directly to the manager and maybe be used in a scheduled task ?!







    On a personal Note:




    This has really given me a reason to start to learn PowerShell (I have been meaning to for ages) and also learn how to use the fantastic new VI toolkit, if nothing else I have gained the valuable experiences of learning PS and the toolkit.  Thanks to the creators.











    Report.ps1 YOURVISERVER





    You will need MS Word and the Office Web Components (script will tell you where to download if not installed)





    This script takes a varied amount of time to run and only reads data, no configuration changes are made at all, obviously the bigger system the longer it will take, not that you would notice if it was a scheduled task.





    The email areas are currently commented out at the end awaiting customisation if needed.





    Sorry if it doesnt work on your VI, I have not been able to test as extensively as I would have liked due to only having one VI.





    Office XP/2003/2007 tested.