4 Replies Latest reply on Dec 11, 2013 12:35 PM by jessem

    What VMs are SRM protected

    jessem Enthusiast

      I tried searching and was confused by some of the search results.  I thought I would re-ask again.  Is there a script that can output to a .csv file that lists what VMs are protected by SRM?

        • 1. Re: What VMs are SRM protected
          LucD Guru
          vExpertUser ModeratorsCommunity Warriors
          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: What VMs are SRM protected
            jessem Enthusiast

            I tried looking at that earlier, and I am having a difficult time understanding it.  If I put that in a .ps1 script, do I have to change any fields?  Where do I run this on?


            Also, I saw this out there and wondered if that will work too?  Only problem is I know to run it on the recovery side, but need to output to clean .csv.

             

            Get-VM |
            where  { @($_.Harddisks | Select -ExpandProperty Name) -contains "Placeholder"} |
            Select
            Name

            • 3. Re: What VMs are SRM protected
              LucD Guru
              User ModeratorsvExpertCommunity Warriors

              No, you don't have to change any fields, just provide the parameters to the call.

              The way to call the script is in the comments on the Usage line.

               

              That 2nd script will work as well, it uses the fact that SRM will give the harddisks of the VMs that are protected a specific name (containing "Placeholder").

               

              To get the result in a CSV, just pipe the result to the Export-Csv cmdlet.

              Get-VM |
              where  { @($_.Harddisks | Select -ExpandProperty Name) -contains "Placeholder"} |
              Select
              Name | Export-Csv report.csv -NoTypeInformation -UseCulture

              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              • 4. Re: What VMs are SRM protected
                jessem Enthusiast

                Ok no luck.  I ran the script and the c:\report.csv file is empty.  I did run it on the recovery site vCenter.  Next steps?