Basic script help

Hello world

I haven't used PowerCLi before (but know previous script).

I need to write a script that will tell me that VM have discs that are thin provisioned. Can anyone help?

Thank you.

David

Try this

It shows what vm and what the VM vmdk is thin

http://www.vcritical.com/2009/01/finding-thin-provisioned-virtual-disks-with-PowerShell/


$vmtp = Get-VM
$vmtp += Get-Template

foreach($vm in $vmtp | Get-View){
  foreach($dev in $vm.Config.Hardware.Device){
    if(($dev.GetType()).Name -eq "VirtualDisk"){
      if($dev.Backing.ThinProvisioned -eq $true) {
        $vm.Name + "`t" + $dev.Backing.FileName
      }
    }
  }
}

Tags: VMware

Similar Questions

  • Help on a basic script

    How to use gotoAndPlay comand with multipal buttons.

    ŒUVRES:

    AA.addEventListener (MouseEvent.CLICK, release);
    function release(evt:MouseEvent):void {}
    gotoAndPlay (5);
    }

    DOES NOT WORK:

    AA.addEventListener (MouseEvent.CLICK, release);
    function release(evt:MouseEvent):void {}
    gotoAndPlay (5);
    }

    BB.addEventListener (MouseEvent.CLICK, release);
    function release(evt:MouseEvent):void {}
    gotoAndPlay (10);
    }

    Thank you!

    You can't duplicate the names of functions, would be one solution...

    AA.addEventListener (MouseEvent.CLICK, releaseAA);
    function releaseAA(evt:MouseEvent):void {}
    gotoAndPlay (5);
    }

    BB.addEventListener (MouseEvent.CLICK, releaseBB);
    function releaseBB(evt:MouseEvent):void {}
    gotoAndPlay (10);
    }

  • Placeholder text replacement script help

    Hello expert AppleScript!

    I have a problem with the script to replace text placeholder from this source: https://iworkautomation.com/pages/script-tags-placeholder-text.html

    For testing purposes I just wrote a text on a white sheet (not insert a text box and the text typed there) and insert an image, a placeholder text marked (and a picture too) through the instrument standard Pages: Format-> advanced-> mark as placeholder text (image) (don't remember the exact wording)

    Then I executed the script but it worked only in part to replace the placeholder image but not the text.

    Is there an error in this script, or maybe I did something wrong?

    Thanks for the help in advance!

    5.6.2 pages

    OS X El Capitan v. 10.11.5

    Hello

    It's a bug when a placeholder is in the body of the text with one of the following conditions:

    No insertion point in the document.

    The insertion point is not in the body of the text (in an text box as example)

    Workaround:

    The script must create a new section in the document, place the insertion point in the body of the text

    ------

    Tell application "Pages".

    activate

    the value of thisDocument to make the new document with properties {model: "Journal Newsletter" template}

    According to thisDocument

    make new section - who put the insertion in the body of the text

    -MAKE ALL TAGS

    -do something with a space reserved

    tell the end

    --------

  • Satellite A200-13O: Vista Ultimate to basic installation help

    I need assistance to the full installation of Windows Vista Edition in my A200-13O.
    My current operating system is Windows Vista Basic and I want to upgrade to Windows Vista Ultimate.
    Based on the download section of driver I need the following drivers must be installed.

    1 Windows Vista RTM
    2 native Intel ICH7M Chipset utility
    3 945GM Intel display driver
    or
    3 nVIDIA Display Driver G72MV-A3/NB7P-GS
    Realtek Audio driver ALC861D 4
    5 Realtek 8101E 10/100 / Driver LAN Gigabit 8111
    6 Synaptics Touch Pad Driver (with LuxPad)
    7 ALPS Touch Pad Driver
    8 card reader TI Multiple digital media
    9 TOSHIBA software modem
    10 Golan Intel Wireless LAN Driver
    11 Kedron Intel Wireless LAN Driver
    12 Atheros Wireless LAN Driver
    Camera Chicony 13 software
    14 Bluetooth Stack for Windows by Toshiba
    15 Bluetooth monitor
    16 TOSHIBA Value Added Package
    17 TOSHIBA Flash Cards Support utility
    TOSHIBA 18 hardware configuration utility
    19 TOSHIBA supervisor password
    20 TOSHIBA SD Memory utilities
    21 TOSHIBA ConfigFree
    22 TOSHIBA Assist
    TOSHIBA Speech System 23
    24 TOSHIBA Extended tiles for Mobility Center Windows V1.01
    TOSHIBA Fingerprint Utility V5.6.0.3221 25

    I have already downloaded most of them, but I can't find some like [2] utility Intel ICH7M Chipset, driver of Kedron Intel wireless LAN [11], [23] TOSHIBA Speech System. Also some drivers are not installed properly.

    Can you please help me.

    Chipset driver you can get on the Intel Web site
    www.Intel.com
    But I think that the pilot could also be in the display driver because it s the same chip.

    The WLAN driver I found on the Toshiba site so download and install it.

    The speech system could be integrated into the audio driver.
    But download and install all the drivers and the system will work.

  • DDL script help

    Hi all

    We are in Oracle 11 g 2 in WIN 2008R2. I want to generate the DDL script for the user to XDX schema. User schema have the sequence type of the object, operator, procedure, package bodies, lob, package, library, type body, trigger, table, index, view, indextype, function and type. I like to shoot all the ddl for these objects to XDX in a script. Please let me know if that's ok. I appreciate your help.

    Go head

    trigger the echo

    set pagesize 0

    set verify off

    Set feedback off

    coil schema.out

    Select dbms_metadata.get_ddl (object_type, object_name, owner)

    Of

    (

    -Convert DBA_OBJECTS. OBJECT_TYPE type of DBMS_METADATA object:

    Select

    owner,

    object_name,

    decode (object_type,

    'EMPLOYMENT', 'PROCOBJ ',.

    'PACKAGE', 'PACKAGE_SPEC ',.

    'PACKAGE BODY', 'PACKAGE_BODY ',.

    'TYPE', 'TYPE_SPEC ',.

    'TYPE BODY', 'TYPE_BODY ',.

    object_type

    ) object_type

    from dba_objects

    where owner in ('XDX")

    -These items are included with other types of objects.

    and not object_type in ('PARTITION of INDEX', 'LOB', 'PARTITION LOB', 'PARTITION TABLE')

    -Ignore the types generated by the system that support the processing of collections.

    and not (object_type object_name like '% SYS_PLSQL_' and 'TYPE')

    )

    order by owner, object_name object_type

    /

    Export utility exp can do the same thing as 1 lining

    If above works for you, then you don't have any other approval

  • FDMEE Jython Script help

    My load the import data were thrown a curve ball. I used to have a 1 or 2 digits in the card. If it's a digit, I simply added a zero at the beginning (i.e. FillL convert 1 01). But now I have a leader 4 digits and a hyphen. So instead of '1', I have 2500-1, instead of "12", I now 2500-12. I need to remove what is to the right of the dash and then add a zero not significant if it is not already 2 digits. Does anyone know the script that would achieve this?

    Your help is very appreciated.

    FA

    Hello

    You can create this jython script and assign import format:

    def customFill (strField, strRecord):

    return ('0' + strField.split("-") [1]) [-2:]

    This function divides your strField using "-" as the delimiter, then him concatenate '0' with the second element ([1] in the table starts in position 0) and finally to take the last two characters [-2:]

    If you have 1 number after the hyphen you will get 0 x. On the other hand, if you have already a 2-digit, you will get xx

    Hope says.

  • Powercli Script Help of misalignment VMDK

    I have a script that I run against a vCenter server. Basically, find all the VMS in vCenter and ruins a command get-wmiobject against them to get the VMNAME, Partition, Offset and status, as well as exports in excel.

    Here is an example of output data that gets exported to excel:

    VMNamePartitionOffsetStatus
    pdxvvmdb1Disk #0 Partition #18193150 KBPartition NOT aligned
    pdxvvmdb1Disk #0 Partition #18193150 KBPartition NOT aligned

    My "problem" is its does not give me the right excel (via information system) partition info, see below.

    He has only 1 vmdk with 2 partitions, so it should output the two partition 1 and 2 and offsets, since they are both incorrect?

    In the research to add a line to the script to add the data store and the location of the vmdk (pdxvvmdb1/pdxvvmdb1.vmdk [PDXESX1_RAID]) file in this case and have the excel output. Possible?

    I have attached the script from his long enough...

    I made the same mistake you did at the beginning, the $Details object must be created at the lowest level.

    Like this

    # Add-PSSnapin vmware.vimautomation.core
    connect-viserver vspheredev
    $myCol = @()
    $mycol.Initialize()
    $vms = get-vm | where {$_.PowerState -eq "PoweredOn" -and $_.Guest.OSFullName -match "Microsoft Windows*" } | Sort Name
    foreach($vm in $vms)
    {
        Try
        {
            $wmi = get-wmiobject -class "Win32_DiskPartition" -namespace "root\CIMV2" -ComputerName $vm -ErrorAction silentlycontinue
            foreach ($objItem in $wmi)
            {
                if ($objItem.StartingOffset % 64kb -eq 0){
                    $Details = "" | Select-Object VMName, Partition, Offset, Status, VMDKPath                $Details.VMName = $vm.name                $details.VMDKPath = $vm.HardDisks[0].Filename                $Details.Partition = $objItem.Name                $details.offset = "$([long]$($objitem.StartingOffset)/1KB)KB"                $Details.Status = "Partition aligned"
                }
                else            {
                    $Details = "" | Select-Object VMName, Partition, Offset, Status, VMDKPath                $Details.VMName = $vm.name                $details.VMDKPath = $vm.HardDisks[0].Filename                $Details.Partition = $objItem.Name                $details.offset = "$([long]$($objitem.StartingOffset)/1KB)KB"                $Details.Status = "Partition NOT aligned"
                }
                $myCol += $Details        }
       }
       catch
       {
            $Details = "" | Select-Object VMName, Partition, Offset, Status, VMDKPath        $Details.VMName = $vm.name        $details.VMDKPath = ""        $Details.Partition = "error"        $details.offset = ""        $Details.Status = "error"        $myCol += $Details    }
    
    }
    $mycol  | Export-Csv -NoTypeInformation "H:\Excel_Reports\NEW_Production_PartitionAlignment.csv" #output errors to file
    $error >>  "c:\temp\partition-check-errors.txt"
    $error.clear()
    

    Note that in the property VMDKPath the script stores the path of the 1st VMDK.

  • Add Nas file systems in a script - Help!

    I have 15 ESXi servers and I need to add about 10 NFS Volumes per server.  There is 'NO WAY', I do it manually.  I know how to add a NAS store via the command-line of vMA.   I need help is adding in a script for all NFS connections.

    Can someone help me to start creating a script where I can add all the connections, so I don't have to add each volume manually?

    vicfg-nas - Server myesx - Host.com - add - nasserver my.netapp.com s/mount dir nfsstore.

    I add all of my NFS connections in a file/script so I can just run and all NFS volumes are mounted?

    Remember, I need an example if possible, I'm a little green on writing scripts for the vMA.

    Just try to make my life easier with the vMA and your assistance.  Thank you for your help in advance.

    If you take a look at the blog, they go on a few examples on how to use vi-fastpass.

    Here's another thread that may be useful - http://communities.vmware.com/message/1587207#1587207

  • permissions / roles scripting help

    Hi guys,.

    I just recently discovered the beauty of the kit VI Toolkit and immediately felt it was necessary for this. I need a script to scroll through each VM in a given datacenter and assign a role existing a permission level on this virtual machine.

    Hierarchy is as follows:

    Datacenters\ & lt; Region & gt; ------& lt; Site & gt; ------& lt; VM name & gt;

    or

    Datacenters\ & lt; Region & gt; ------& lt; Site & gt; ------& lt; Folder & gt; ------& lt; VM name & gt;

    I need the script to parse the name of the virtual machine, and then assign the VirtualMachineUser role to the Group of field domain\\user & lt; VM name & gt;. _Admins

    Any help would be greatly appreciated!

    Thank you!

    Looks like this means to use a code level API to access the Manager.

    http://communities.VMware.com/message/1076484#1076484

    I adapted the code example is the post above and below the code, just worked in my lab, but please limit testing to a couple of servers before you set loose.

    #pipe virtual machines to Get - view to get the .net objects representation

    #you need for the MoRef required by the SetEntityPermission method

    #recommend for tests that limit you to a specific set of virtual machines using Get-VM-name (list of names separated by commas)

    $vms = get - VM | Get-View

    #access authorization manager

    $authMgr = get-View Manager

    #use a filter against the Manager very well the role you want

    $role = $authMgr.RoleList |? { $_. Name - eq "VirtualMachineAdministrator"}

    foreach ($vm to $vms)

    {

    #create permissions

    $perm = new-Object VMware.Vim.Permission

    $perm.group = $false

    $perm.principal = "Domain\\user"$vm. Name"_Admins".

    $perm.principal

    $perm.propagate = $false

    $perm.roleId = $role. RoleId

    #for each VM discovers, call the method to update the permissions

    $authMgr.SetEntityPermissions($vm.) MoRef, $rootperm)

    }

    I hope this helps!

    ======================================

    Monitor. To correlate. Act. | vWire.com

  • If/then box script help in the form of Adobe Acrobat...

    If having a purchase order that has two different fields of price (regular price per point & subscription price per article for each line item, then a quantity) and then a total field. Finally, there is a checkbox on the form indicating if they sign up for a monthly subscription.

    What I try to do is create a script that totals each line by the current price multiplied by the quantity or the price of the subscription by amount if the subscription checkbox is checked ("Yes"). So far, I've tried several scripts, I found in the forum but no luck at all.

    The box is near the billing fields down, so all the line items first appear in the upper part of the form. Thus, an individual if each line and calculations would amount in total to each line (reg * qty price) when you get off of the form... When you check the subscription all line totals would have changed to reflect the subscription rates on each line (which may be different). Just need help with a single line and I can duplicate for each line...

    Here's what I does NOT again...:

     (function () {
    
    
    if (this.getField("sub").value==="Yes") {
         var b1 = this.getField("Price1b");
         var c1 = this.getField("Qty1");
         var d1 = this.getField("Price1");
         event.value = b1.value * c1.value;
    } else event.value = d1.value * c1.value;
        }
    
    
    )();
    
    

    Try this:

    (function () {}

    var b1 = getField("Price1b").value;

    var c1 = getField("Qty1").value;

    var d1 = getField("Price1").value;

    If (getField("sub").value = 'Yes') {}

    Event.Value = b1 * c1;

    } else {}

    Event.Value = d1 * c1;

    }

    })();

  • Report Script Help

    Hi all

    Is there a formula in a report script to achieve the following objectives.

    I have the hierarchy below->

    B
    -b1
    -b2
    -b3

    All the children of the 'B' are stored members.

    Is it possible to get the 'B' = 'B'-'b1 '.

    Thank you

    My first thought was that you could do with RANK of CALCULATE, but when I really tried to do, it seems surprisingly tedious. For example, it works on Sample.Basic to create a new "East", which is actually "East"-"New York" (roughly the equivalent of what you're looking to do):

    
    

    There could be a much more accurate method, but at least it shows that it is possible. The thing is that the "East" referred to in the SAVEROW / SETROWOP / PRINTROW is not a member of the "East"; It's a calculated line. SUPOUTPUT hides the display of the "East" 'real' line and the line "New York", which is subtracted from the "East". All of these commands are in the technical reference information.

    Not sure I am a fan of creating output that resembles an existing Member, but returns a different value, however. Users are so easily confused... :)

  • Java Script Help

    I have a table in a form with a text filed and a numeric field. I have the deposited text populated by a button.  (For instance I have fixed windows elements, tilt and turn Windows, beats Windows, project in windows, then I simple Outswing doors, Inswing French doors and so on.) I wish that when someone selects an element that was a door in the numeric field if the size is larger, then 108 "the user would have a popup saying you must have a smaller size 108"if they choose a list window, the popup say you must have a size of less than 80")

    Your help with this script would be greatly appreciated.

    Here's the corrected code that works if the field width output.

    var i = this.parent.index;

    If (xfa.resolveNode ("Table1.Row1 [" + i + "]").) Item.rawValue == "680 ch" & this.rawValue > 108) {}
    xfa.host.messageBox ("you must have a size of less than 108");
    xfa.host.setFocus ("Width");
    }

    Two things to fix.

    (1) in your code, you have special characters after 108 (double quotes. You could have copied and pasted. You can check the double quotes of beginning and end of double quotes are not the same.)

    (2) the line1 is attached to a dynamic section. So always check the current line get field values.

    Thank you

    Srini

  • Script help please. You will need to save it as a different file type.

    I have a script which now saves files as jpg files.  I need to save a png image.  Someone would be able to help me with this?

    var doc = app.activeDocument;

    var Path = doc.path;

    var Name = doc.name.replace (/ \.) [ ^\.] +$/, ''); Var suffix = "_full_l"; var saveFile = file (path + "/" + "full_l" + ".jpg"); SaveJPEG (saveFile, 8);

    function SaveJPEG (saveFile, jpegQuality) {jpgSaveOptions = new JPEGSaveOptions(); jpgSaveOptions.embedColorProfile = true; jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE; jpgSaveOptions.matte = MatteType.NONE; jpgSaveOptions.quality = jpegQuality; activeDocument.saveAs (saveFile, jpgSaveOptions, true, Extension.LOWERCASE) ;}}

    Here you are...

    var doc = app.activeDocument;
    var Path = doc.path;
    var Name = doc.name.replace(/\.[^\.]+$/, '');
    var Suffix = "_full_l";
    var saveFile = File(Path + "/" + "full_l" + ".png");
    SavePNG(saveFile);
    function SavePNG(saveFile){
        pngSaveOptions = new PNGSaveOptions();
        pngSaveOptions.embedColorProfile = true;
        pngSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
        pngSaveOptions.matte = MatteType.NONE;
        pngSaveOptions.quality = 1;
     pngSaveOptions.PNG8 = false;
        pngSaveOptions.transparency = true;
    activeDocument.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);
    }
    
  • Basic Basic script questions

    I downloaded the free trial version Acrobat Pro 9. I have problems to run before buy you.

    (1) I am only able to use LiveCycle to create a form from scratch. Is this normal?

    (2) I am trying to run a script to check which item is selected in a drop-down list, and then fill the other text boxes with data. I put the Javascript code in the script editor window, but when I run the form and select an item in the drop-down menu that nothing happens. I doesn't appear I am executing the code. I tried to put the code after the change event in the editor and also test the event change (if (object.change)) with no result. I don't know I'm missing something here, but simple...

    (3) I tried to enter the script without going into LiveCycle using the advanced editing toolbar, but the largest part of the tool bar is grayed out. Double click the menu drop-down is not in place the pallet allowing me to enter in a script.

    Any help is appreciated! Thank you!!

    Hi Bil95722,

    Maybe these videos on creating your first form in Acrobat will help you out.

    http://www.pdfscripting.com/public/34.cfm#FirstForm

    Hope this helps,

    Dimitri

    WindJack Solutions

    www.pdfscripting.com

    www.windjack.com

  • How-to - Basics or help that doesn't...

    I've been away from Flash for almost 10 years and now that I'm back I remember to do certain things, but I do not remember HOW to make them.

    At the time, I could open the help file, search and quickly find an answer. NOW - I open the help file, for search and get nothing but irrelevant responses ALL I WANT are very simple instructions. I tried the tutorials online and, although they help, they are not complete and often ignore very basic but essential details. I tried searching the forums and I get notes even more irrelevant. It seems that nobody is asking fundamental questions or the son who treats just bases do not appear in the results of my research.

    know that once I started, it will all seem to be very simple, but it's so hard start. There must be a better way.

    Even if I'm here, I might as well asking for what I'm looking for - how you apply a label to an image?

    Thank you.

    Well... If you are using cs4 or cs3... When you click on a certain range - you can name on the right side of the scene you have LABEL > name - and insert the desired name...  I hope that's what you're looking for!   Best regards, Tudor

Maybe you are looking for