Script PowerShell for VM and storage

I'm also looking for a Powershell script for more information about the storage. I'm looking for especially for one who says that VM is connected to the storage. WDR info would be nice.

Thank you

Mike

Mike,

The first script gives you information on all hard drives all the VM is connected to:

Get-VM | `
  ForEach-Object {
    $VM = $_
    $VM | Get-HardDisk | `
      ForEach-Object {
        $HardDisk = $_
        $Report = "" | Select VM,HardDisk,Filename,DiskType,CapacityKB,ConnectionState,Persistence,StorageFormat,Id,ParentId
        $Report.VM = $VM.Name
        $Report.HardDisk = $HardDisk.Name
        $Report.Filename = $HardDisk.Filename
        $Report.DiskType = $HardDisk.DiskType
        $Report.CapacityKB = $HardDisk.CapacityKB
        $Report.ConnectionState = $HardDisk.ConnectionState
        $Report.Persistence = $HardDisk.Persistence
        $Report.StorageFormat = $HardDisk.StorageFormat
        $Report.Id = $HardDisk.Id
        $Report.ParentId = $HardDisk.ParentId
        Write-Output $Report
      }
  }

The second script show data warehouses that all VMs are associated with:

Get-VM | `
  ForEach-Object {
    $VM = $_
    $VM | Get-HardDisk | `
      ForEach-Object {
        $HardDisk = $_
        $Report = "" | Select Name,Datastore
        $Report.Name = $VM.Name
        $Report.Datastore = $HardDisk.Filename.Split(" ")[0]
        Write-Output $Report
      }
  } | `
  Sort-Object -property Name,Datastore -unique

Robert

Tags: VMware

Similar Questions

  • Cannot install Script Bay for CS5 and CS6 - invalid Signature

    I tried to reinstall the extension Script Bay because it wasn't somehow, and he refused to install to invalid signature. I installed this extension repeatedly on the current and old PC before but this is the first time that I have this experience.

    I saw a few solutions for the installation of extensions, but they were for Mac, not windows. And apparently Adobe does not support higher versions of Extension for Windows drivers. Is there a solution to this?

    Bay of script has been updated:

    http://in-tools.com/article/script-Bay/script-Bay-update/

  • I have two script. one for indesign and another for photoshop. How can I combine the two scripts?


    Hi all

    I have a script for indd that convert a table selected user in JPG format (1276 px width, height varies). Second script photoshop asking to select jpg file and then check if the height in pixels is less than 1018 pixel, can he expand canvas size (height) to 1018 px.

    How can I combine the two script, tip, or how to start would be useful? The workflow must be:

    • the user select table in the indd document
    • export table in jpg format
    • script you will be asked to select the file table jpg or if it is possible to automate this would be awesome.
    • enlarge the height of the canvas to 1018 px

    Thank you

    Marie rosine

    PS: I have already read the Java script tool guide pdf but unable to understand

    Yes and the documentation is pretty self-explanatory.

    However, here is an excerpt:

    function callPhotoshop(file) {
       var bt = new BridgeTalk;
    
       bt.target = "photoshop";
    
       bt.body = "function main (){ return confirm('Am I in Photoshop?'); }; main();";
    
      bt.onResult = function(resObj)
      {
      var myResult = resObj.body;
      alert( myResult? "PS code was correctly executed" : "Something wrong happened" );
      }
    
       bt.send();
    }
    
    callPhotoshop();
    

    HTH,

    Loïc

    http://www.ozalto.com

  • Cannot run script queued for roles and privileges


    Hi all;


    I'm recreating a u1 user and also try to attempt to define the roles and privilege from the file put on hold.

    but I get the error message.


    $ cat f1.sql

    GRANT CONNECT to u1

    Grant RESOURCE to u1

    Grant CREATE SESSION to u1

    Grant UNLIMITED TABLESPACE to u1

    Grant CREATE TABLE to u1

    Grant CREATE ANY TABLE to u1

    Grant CREATE the CLUSTER to u1

    Grant CREATE SYNONYM to u1

    Grant CREATE VIEW to u1

    Grant CREATE SEQUENCE to u1

    Grant CREATE ANY SEQUENCE to u1

    Grant CREATE DATABASE LINK to u1

    Grant CREATE PROCEDURE for u1

    Grant CREATE TRIGGER to u1

    Grant CREATE TYPE U1

    GRANT CREATE OPERATOR to u1

    Grant CREATE INDEXTYPE U1

    SYS > create the u1 user identified by u1;

    Created by the user.

    SYS > @f1.sql;

    5

    DB version is 11.2.0.1 on redhat 4.7

    Thank you

    Where are you semicolons?  Each command must end with a semicolon.

    Hemant K Collette

  • do I need Windows PowerShell integrated scripting tool for home computer and access to the internet, powershell

    do I need Windows PowerShell integrated scripting tool for computer and internet access

    No you didn't he need for home computer and internet access

  • Isolate the vMotion and storage traffic?

    We use ESXi 5.1 using two physical switches for management traffic and two physical switches for VM and storage vMotion traffic. We use a DVSwitch with VLANS separated for VMs (125), storage (126) and vMotion traffic (127). My question is really about the physical switch setting. I have installation of VLANs, 125, 126 and 127 on my main switch with each of them having a layer 3 interface. I think that only the network of the VM (vlan 125) needs a layer 3 interface. In other words, my VLAN storage and vMotion is not routable by removing the 3 layer interface.

    Does this sound correct?

    Another twist, I have a Juniper switch where all layer 3 interfaces are defined. It is connected to 4 switches in the rear of my IBM Bladecenter. Two of these switches are Cisco 1 GB switches that carry all traffic to the management through a vSwitch network. The other two switches are BNT 10 GB switches that carry traffic for Storage vMotion and VMs. Of course, it's a network connection, because it carries several VLANS.

    My only question now is should I eliminate interface layer 3 on my storage network located on one vlan separate

    Well, you need your storage system accessible on these IP addresses by the systems for the management of the other subnets or such? You already have all traffic from subnet inter between iSCSI and other networks? If this isn't the case, then there is no need to have routable iSCSI network.

    For the ESXi hosts themselves there is usually zero reason to have vmkernel iSCSI interfaces be routable since you already do management etc on another routable network (and responses of hosts would be sent there as well except if you define static routes custom).

  • Windows PowerShell 2.0 and WinRM 2.0 for Windows Vista (KB968930) download size: 32.5 MB

    I am trying to install (Windows PowerShell 2.0 and WinRM 2.0 for Windows Vista (KB968930) download: recommended; size: 32.5 MB), but he does not always have the time. Annoying cause he invited me again to install and/or tries whenever I closed which is an offset in time. How to succeed or get rid of it?

    Hello

    For PowerShell check with the TechNet Forum and MSDN Forums.

    TechNet forums
    http://social.technet.Microsoft.com/forums/en-us/categories/

    TechNet - Windows PowerShell Forum
    http://social.technet.Microsoft.com/forums/en-us/winserverpowershell/threads

    Windows PowerShell
    http://msdn.Microsoft.com/en-us/library/aa973757 (vs.85) .aspx

    Writing scripts with Windows PowerShell & download link
    http://TechNet.Microsoft.com/en-us/scriptcenter/PowerShell.aspx

    How Do i: Windows PowerShell 2.0?
    http://TechNet.Microsoft.com/en-us/Windows/dd320288.aspx

    Windows PowerShell
    http://en.Wikipedia.org/wiki/Windows_PowerShell

    Windows management framework (Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0)http://support.microsoft.com/kb/968929

    I hope this helps.

  • Windows PowerShell 2.0 and WinRM 2.0 for Windows XP and Windows Embedded (KB968930)

    Windows PowerShell 2.0 and WinRM 2.0 for Windows XP and Windows Embedded (KB968930)

    Hello

    ·         What exactly is the problem you are facing with this update?

    ·         You are able to install this update?

    If you encounter a problem installing this update you can try to install manually from the link and check if it helps:

    http://www.Microsoft.com/download/en/details.aspx?ID=16818

  • Windows Powershell 2.0 and WinRM 2.0 for Windows Vista (KB968930) update - fail with the error 800b0100 Code

    Original title: several installation update of Windows Powershell 2.0 and WinRM 2.0 for Windows Vista (KB968930) but fails with the error 800b0100 - tried Code recommended fixed but nothing works - any ideas? Alan R

    Installer standalone and patches already installed - laptop Medion used - all other updates loaded ok - also tried PC Tuneup of Maestro.

    Hi Alan,

    Thank you for visiting Microsoft Community.

    To resolve the problem with the installation of the updates, follow these methods:

    Method 1:

    See the article and check if that helps:

    Error 0x800B0100 when you try to install updates for Windows or Microsoft Updates

    Method 2:

    Important: this section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs.

    For more information about how to back up the registry, see the link:

    Back up the registry

    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-the-registry

    I suggest that you follow the steps described in the article and try to reset Windows Update components:

    How to reset the Windows Update components?

    http://support.Microsoft.com/kb/971058

    I hope this helps. If you have additional questions on the computer, please ask your question about Windows and we will be happy to help you.

  • Windows Update - Windows PowerShell 2.0 and WinRM 2.0 for Windows Vista (KB968930) - Code 80070057

    I use Windows Update to install updates for my Windows Vista laptop.

    The update that I am installing is Windows PowerShell 2.0 and WinRM 2.0 for Windows Vista (KB968930).
    I get the error code is Code 80070057.
    I just did a check disk Local and it still does not work.

    80070057 - ERROR_INVALID_PARAMETER. Third party service that is running in the computer creates the problem. Please do a clean boot, and then install the update.

    http://support.Microsoft.com/kb/929135
    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    or

    Description and the Windows Vista CheckSUR update for Windows Vista for x 64 systems
    http://support.Microsoft.com/kb/947821
    80070057 - ERROR_INVALID_PARAMETER 0 x - the parameter is incorrect.

  • Error code 80073712; the installation of Powershell 2.0 and WinRM 2.0 for Windows, 34.3 MB failed. Why he moved?

    Icon bottom right of my screen windows update said I got a major update and three optional updates. I tried to install the update important Powershell 2.0 and WinRM 2.0 for Windows, 34.3 MB. The installation failed. History of the update of the review, I have seen that this is the third day, the installation failed for my scheduled time of automatic updates. Why he moved? If I really need to install it, what can I do?

    Hello

    1. are you able to install other updates successfully?
    2 have you made changes on the computer before this problem?
    You can read the following article.
    Error code 0 x 80073712 occurs in Windows Update or Microsoft Update
    http://support.Microsoft.com/kb/957310
    Note: make sure that you back up all your data before you begin the installation. Check out the link.
    Back up your files
    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-your-files
    See also:
    You receive the error code "0 x 80073712" or the "Windows features" dialog box is empty when you try to install the updates or components in Windows 7 or Windows Vista
    http://support.Microsoft.com/kb/931712
    It will be useful.
  • What is the date of GA of Foglight for Enterprise Virtualization v. 7.0 and Storage Manager 3.0

    Hello

    I was wondering what should Foglight for Enterprise Virtualization v. 7.0 and Storage Manager 3.0 available for download

    Thank you

    Eli

    Foglight for virtualization 7.0 is now available on Supportlink here. Storage Management 3.0 is available here.

  • WLST Script to create the domain weblogic for IOM and OAM

    Hello

    I intend to set up PS3 IOM - OAM in the new environment. We intend to perform the installation in silent mode. Does anyone have example WLST to create the domain weblogic for IOM or OAM?

    Thank you

    Here is an example of OUD. I post this one since it's the simplest and shortest, but it is the same for OAM and IOM except that the script is much longer because they ask a lot more questions. You will need to export the variables used or replace them with the appropriate values for your system.

    wait-<>

    the value of timeout 600

    spawn ${OUD_BASE}/${WLS_NAME}/common/bin/config.sh mode = console

    # Create a WebLogic domain

    wait {}

    {"Enter the index number to select GOLD *" {send "1\n"}}

    # Choose the components of the Weblogic Platform

    wait {}

    {"Enter the index number to select GOLD *" {send "1\n"}}

    # | ___Oracle directory Services Manager - 11.1.2.3.0 [Oracle_OUD1] [3]

    wait {}

    {"Enter number exactly as it appears in the media *" {send "3\n"}}

    wait {}

    {"Enter number exactly as it appears in the media *" {send "n"}}

    # Change the domain information

    wait {}

    "" Enter the value of * "{send" ${OUD_DOMAIN_NAME} \n "}}"

    wait {}

    {"Enter the number of the option to select GOLD *" {send "n\n"}}

    # Select the target area for this domain directory

    wait {}

    {'Enter' new target location GOLD * {send "${OUD_BASE} / user_projects/domains\n"}}

    wait {}

    {'Enter' new target location GOLD * {send "n\n"}}

    # Configure password and username administrator

    wait {}

    {"Enter the number of the option to select GOLD *" {send "2\n"}}

    wait {}

    "" Enter new * "{send" ${WLS_PASS} \n "}}"

    wait {}

    {"Enter the number of the option to select GOLD *" {send "3\n"}}

    wait {}

    "" Enter new * "{send" ${WLS_PASS} \n "}}"

    wait {}

    {"Enter the number of the option to select GOLD *" {send "n\n"}}

    # Configuration mode field-> 1 | Development mode

    wait {}

    {"Enter the index number to select GOLD *" {send "1\n"}}

    # Java SDK selection

    wait {}

    {"Enter the index number to select GOLD *" {send "2\n"}}

    wait {}

    {'Enter' new JVM Directory GOLD * {send "${JAVA_HOME} \n"}}

    wait {}

    {'Enter' new JVM Directory GOLD * {send "n\n"}}

    # Select Optional Configuration

    wait {}

    {"Enter the index number to select GOLD *" {send "1\n"}}

    wait {}

    {"Enter the index number to select GOLD *" {send "n"}}

    # Configure the Administration Server

    # Change "Listen port.

    wait {}

    {"Enter the number of the option to select GOLD *" {send "3\n"}}

    wait {}

    "" Enter the value of * "{send" ${ODSM_PORT} \n "}}"

    # Change 'SSL enabled.

    wait {}

    {"Enter the number of the option to select GOLD *" {send "4\n"}}

    wait {}

    {"Enter the index number to select GOLD *" {send "1\n"}}

    # Change 'SSL listening Port.

    wait {}

    {"Enter the number of the option to select GOLD *" {send "4\n"}}

    wait {}

    "" Enter the value of * "{send" ${ODSM_SPORT} \n "}}"

    # Then

    wait {}

    {"Enter the number of the option to select GOLD *" {send "n\n"}}

    # wait for install

    wait {}

    {"Successfully created * field *" {send "\n"}}

    EXPRESSIONS OF FOLKLORE

  • Script - missing and hotfixes installed for ESX and ESXi

    Can I have the script i.e. missing and hotfixes installed for ESX and ESXi using the CLI power only? out put should be csv format

    You reset the content of the table $Results on each iteration of the baseline.

    Try like this

    $Results = @()
    foreach($esx in Get-VMHost) {
      foreach($baseline in (Get-Compliance -Entity $esx -Detailed | where {$_.Status -eq "NotCompliant"})){
        $Results += $baseline.CompliantPatches |    Select @{N="Host";E={$esx.Name}},    @{N="Status";E={"Compliant"}},    @{N="Baseline";E={$baseline.Baseline.Name}},Name,ReleaseDate,IdByVendor,    @{N="KB";E={(Select-String "(?http://[\w|\.|/]*\w{1})" -InputObject $_.Description).Matches[0].Groups['url'].Value}}
    
        $Results += $baseline.NotCompliantPatches |    Select @{N="Host";E={$esx.Name}},    @{N="Status";E={"NotCompliant"}},    @{N="Baseline";E={$baseline.Baseline.Name}},Name,ReleaseDate,IdByVendor,    @{N="KB";E={(Select-String "(?http://[\w|\.|/]*\w{1})" -InputObject $_.Description).Matches[0].Groups['url'].Value}}
      }
    }
    $Results
    

    It will give the installed and lack of patches which are defined in the non-compliant baslines related to the ESXi host.

    If you want to see all the lines, also the most consistent, omit the Where clause on the base line (foreach) loop.

  • I'm on a W7 PC, of FlashProCC. -Have a Z1, jpg in the library. Choose Properties, export for ActionScript and get name Z1, class flash.display.BitmapData - how I introduce in a display by using Action Script 3.0 object?

    I'm on a W7 PC, of FlashProCC. -Have a Z1, jpg in the library. Choose Properties, export for ActionScript and get name Z1, class flash.display.BitmapData - how I introduce in a display by using Action Script 3.0 object?

    var z1:Bitmap = new bitmap;

    Z1. BitmapData = new Z1 (1,1);

    yourDisplayObject.addChild (z1);

Maybe you are looking for