1 2 3 Previous Next 31 Replies Latest reply on Sep 7, 2010 2:03 AM by AlbertWT Go to original post
      • 15. Re: Reporting through Powershell
        flipster Novice

         

        Hi Humpa,

         

         

         

         

         

        Nice script. Can you kindly post the actual script file?

         

         

         

         

         

        Thanks!

         

         

         

         

         

         

         

         

        • 16. Re: Reporting through Powershell
          pvjsingh Novice

          Hi,

           

          I am having a problem running this script since upgrading to 3.5U4.

           

          See: http://communities.vmware.com/docs/DOC-10327

           

          Error:

          Incomplete string token.

          At C:\Program Files\VMware\Infrastructure\VIToolkitForWindows\Scripts\Healthcheck.ps1:121 char:270

          +     $vmhosts | Sort Name -Descending | % { $server = $_ |get-view; $server.Config.Product | select { $server.Name },

          Version, Build, FullName }| ConvertTo-Html â?"body "<H2>$cluster Cluster Information.</H2>" -head "<link rel='styleshee

          t' href='style.css' type='text/css' / <<<< >" | Out-File -Append $filelocation

           

          Any ideas?

           

          Jason

           

          http://www.ttgapers.com

          • 17. Re: Reporting through Powershell
            LucD Guru
            vExpertUser ModeratorsCommunity Warriors

            Is the text â?" between the Convert-To-Html and the -body parameter ?

            Or did happen due to the copy and paste to this thread ?

             

            I just ran the script HealthcheckEDITED[1].ps1 on a VC 2.5u4 without a problem.

            Which script did you use ? There are several attached to that thread.

             

            From where do you run the script ?

            PowerCLI prompt, Windows scheduled task, EcoShell, PowerGui, PowerShell Plus,... ?

            And with which version of PowerCLI ?

            Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
            • 18. Re: Reporting through Powershell
              pvjsingh Novice

               

              Hi,

               

               

              I am running the script from Powershell prompt as I usually do.

               

               

               

              Thanks.

               

               

               

              http://www.ttgapers.com

               

               

              • 19. Re: Reporting through Powershell
                pvjsingh Novice

                 

                Oh, the funny "a" is really a "-", believe a copy and paste issue.

                 

                 

                Jason

                 

                http://www.ttgapers.com

                 

                 

                • 20. Re: Reporting through Powershell
                  LucD Guru
                  Community WarriorsvExpertUser Moderators

                  Which of the Healthcheck scripts did you use ?

                  There are several in this thread.

                   

                  Could you perhaps attach your script ?

                  Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                  • 21. Re: Reporting through Powershell
                    pvjsingh Novice

                    Please see attached. Which one in your opinion is the most up to date?

                     

                     

                     

                     

                    http://www.ttgapers.com

                    • 22. Re: Reporting through Powershell
                      pvjsingh Novice

                       

                      Hi,

                       

                       

                      More info. In fact when i look at the script in PSPad or notepad, I do not see those weird characthers, but for some reason Powershell interprets like that.

                       

                       

                      If I do a search for "-" in the doc, it finds zero occurrences, although we know it's there.

                       

                       

                      I am using latest version of PSPad, Notepad.

                       

                       

                      I am running Vista SP2 with Powershell 1.0 and the VI Toolkit 1.5 for Windows. ESX is 3.5U4 with VC 2.5

                       

                       

                      Thanks,

                       

                       

                      http://www.ttgapers.com

                       

                       

                      • 23. Re: Reporting through Powershell
                        LucD Guru
                        vExpertUser ModeratorsCommunity Warriors

                        I would advise you to upgrade to the latest version, PowerCLI v4.

                         

                        I ran the script you attached in a VC2.5/ESX 3.5u4 environment without a problem.

                        But I ran it with PowerCLI v4.

                        And I ran it from the PowerCLI prompt.

                        Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                        • 24. Re: Reporting through Powershell
                          pvjsingh Novice

                           

                          Hi,

                          I can confirm the problem is with PSPad/Notepad text editors and the handling or dashes and quotaion marks. The funny characters showup in Wordpad and are then edited. the script then runs fine using either 1.5 OR 4.0 CLI.

                           

                           

                          thanks for your help.I am editing the script up a bit and hopefully can post a nice consolidated one that accounts for all reporting (and can be scheduled).

                           

                           

                          Jason

                           

                           

                          http://www.ttgapers.com

                           

                           

                          • 25. Re: Reporting through Powershell
                            pvjsingh Novice

                             

                            Hi,

                             

                             

                            I have updated this excellent script to do a bit more. I have utilized/modified the works of:

                             

                             

                            1. Ivo Beerens (started this wonderful script)

                             

                             

                            2.  Ade Orimalade (Avge. Memory Usage)

                             

                             

                            3. esarakaitis @ vmwarescripting.com (check this site out if you have not already, and bookmark it)

                             

                             

                            4. Bill Scott (removal of style.css and embedding report into email (no need for attachement)

                             

                             

                            Changes are:

                             

                             

                            1. - Stylesheet settings to body so email can be sent HTML formatted

                            2. - Removed style references in every table addition

                            3. - Avge Daily and Memory Usage to VM Statistics (Thanks Ade Orimalade)

                            4. - NTP Servers (Thanks esarakaitis at www.vmwarescripting.com)

                            5. - Verify NTP Client running (Thanks esarakaitis at www.vmwarescripting.com)

                            6. - Service Console IPs (Thanks esarakaitis at www.vmwarescripting.com)

                            7. - List Virtual Switches (Thanks esarakaitis at www.vmwarescripting.com)

                            8. - List Virtual Switches Port Groups and Security (Thanks esarakaitis at www.vmwarescripting.com)

                            9. - Change Time Sync to see ENABLED guests since we sync with AD

                            10. - Added html file to body of email (Thanks Bill Scott)

                             

                             

                            Please see attached and let me know what you think.

                             

                             

                            I have run this manually and from schedule and it works fine.

                             

                             

                            Thanks,

                             

                             

                            Jason

                             

                             

                            http://www.ttgapers.com

                             

                             

                            • 26. Re: Reporting through Powershell
                              FirstByte Novice

                               

                              Am having trouble getting the HealthCheck script to work. I am new to Powershell, but am familiar with VMware, and would like to produce some custom reports. I have PowerGUI installed, so am also just learning my way around that user interface for that.

                               

                               

                              I have one VirtualCenter server (VI3), with multiple Datacenters, with mutiple folders, with multiple clusters of hosts.

                               

                               

                              How can I get a list of virtual machines (either for whole datacenter, or for individual cluster etc) with VM details like, Name, Datastore location of disks, size of disks, PortGroups it belongs to, memory, NumCPUs, GuestOS, floppy drive attached, CD drive attached/connected, IP address, power state, VMware Tools status? Can someone help with the script for this - it would be a great help - either to run in the CLI, or as a report I can click on in PowerGUI?

                               

                               

                              Thanks in advance

                               

                               

                              Darren

                               

                               

                               

                               

                               

                              • 27. Re: Reporting through Powershell
                                mattroblin Novice

                                 

                                If you are looking for PowerShell / VMware tools you might find the VESI better - it is directly aimed at Virtual platforms and is based on the same platform as PowerGUI. They released version 1.2 a week ago and has some Best Practice features now which are very good for morning reports.

                                 

                                 

                                http://www.thevesi.org/index.jspa

                                 

                                 

                                Alan Renouf just released version 3 of this Daily Report which also has a ton of useful checks ...[http://www.virtu-al.net/2009/11/04/vcheck-daily-report-v3/] and he released a lot of his scripts in a PowerPack for PowerGUI / VESI the other day.

                                 

                                 

                                You should be able to build what you need by viewing the code of the script packs and tweaking them to what you want.

                                 

                                 

                                 

                                 

                                 

                                 

                                 

                                 

                                 

                                 

                                 

                                 

                                 

                                 

                                • 28. Re: Reporting through Powershell
                                  FirstByte Novice

                                   

                                  Thanks for the reply and the links mattroblin, but the problem is I don't know how to "tweak" the scripts unfortunately...

                                   

                                   

                                  The VESI interface looks cool, and that DailyCheck script would appear to give a lot of useful information (perhaps too much).... (It took me about an hour just to work out how to kick the script off, and then after about two hours of running I cancelled it - because it appears to run on the entire VC, instead of promting for a folder or Cluster)

                                   

                                   

                                  The VESI gives some basic reports that could be helpful, but would be great if it were possible to custom select some extra columns, so that when it reports on Virtual Machines, it reports all the info the you would find if you went to VirtualCenter, right-clicked on the VM, and Edit Settings... Things like which Network Adapter it is connected to; VMware Tools Status; Boot Delay etc  Is there any way to add these particular fields for reporting, or is the only way to get something scripted - because that would be a showstopper for me...

                                   

                                   

                                  Thanks

                                   

                                   

                                  • 29. Re: Reporting through Powershell
                                    DougBaer Master
                                    VMware Employees

                                    In general, you can get datastores for a given cluster by passing the output of Get-Cluster to Get-VMHost then to Get-Datastore.  That doesn't give you anything pretty, but may get you part way there.  For some more interesting data, look at this script

                                    http://www.peetersonline.nl/index.php/vmware/check-vmware-configuration-with-powershell/

                                     

                                    Cheers,

                                    Doug

                                     

                                      • apologies for accidentally resurrecting this old thread -- my browser didn't render the second page of the thread