Need help simple script

Hi guys,.

Need some help im working on a series of steamers one very simple but as im only learn Powershell atm I hit an obstacle. I would like to get a list of the strategy of starting for all my guests so far I

Get-VMHost | Get-VMHostStartPolicy | FT - autosize

That works very well but does not give me the friendly name of the host, I guess I can get probably that but don't know how.

Thanks in advance

www.virtualisedreality.com | www.Twitter.com/virtualisedreal

Here's a way to do it, I'm sure there is an easier way, that I just can't think of it right now!

$MyObj = @()
Foreach ($vmhost in Get-VMHost){
     $StartupPolicy = Get-VMHostStartPolicy -Vmhost $vmhost
     $Details = "" | Select VMHost, Enabled, StartDelay, StopAction, StopDelay, WaitForHeartbeat
     $Details.VMHost = $vmhost.Name
     $Details.Enabled = $StartupPolicy.Enabled
     $Details.StartDelay = $StartupPolicy.StartDelay
     $Details.StopAction = $StartupPolicy.StopAction
     $Details.StopDelay = $StartupPolicy.StopDelay
     $Details.WaitForHeartbeat = $StartupPolicy.WaitForHeartbeat
     $MyObj += $Details
}
$MyObj

If you found this information useful, please consider the allocation of points for correct or helpful.

Alan Renouf

http://Virtu-al.NET

Tags: VMware

Similar Questions

  • Of script Lady no need a simple script to work with labels...

    I have everyone! I know that I've already should I have learned Javascript. God knows I've really tried, but I couldn't cope with the work. Again, I must ask my dear Scripting Guys to fix this for me!

    It goes like this: I'm going to start publication of some books that have a lot of points with different tabs. There are many it is really difficult to solve problems with paragraph styles.

    What I need is a script that could mimic the operation of the two buttons that are available in Word format

    IncreaseDecrease.PNG(Increase and decrease the indent level of the paragraph [to the default tab next or previous already established in this paragraph style]).

    Can someone help me?

    Thank you in advance,

    Maria

    Maybe I was not quite clear. Since tabs could not be repeated, making the general script enough to handle the case of say, the tabs set at 10mm, 25mm, 31mm, 46mm and 70mm might be a bit difficult. But if we can assume that they all go to repeated intervals (10mm, 20mm, 30mm, 40mm, 50mm, 60mm, 70mm), it is much easier.

    Two scripts. Save it as increaseIndent.jsx:

    app.selection[0].leftIndent+=app.selection[0].tabStops[0].position;
    

    And then decreaseIndent.jsx:

    app.selection[0].leftIndent-=app.selection[0].tabStops[0].position;
    

    Simply, it increases or decreases the leftIndent of the current selection by the position of the first tab stop of the same selection.

  • Need help with script java folder level for silent registration with unique file name

    That's what I'm trying to do

    1. when a person completes the request on one of our computers in the office, there will be a button send at the bottom of the application.

    2 submit the application on is automatically stored on the local server with the file name determined by the fields name and surname on the application.

    example - John Doe Application.pdf

    Saved in the folder C:\Users\Station1\Desktop\FinishedApplication.jpgApplications

    3. This is the example of code I found, but I don't know how to enter which fields determine save name and where to save it to.

    http://thelivecycle.blogspot.de/2015/06/save-with-new-name-in-specified.html

    http://thelivecycle.blogspot.de/2015/06/save-with-new-name-in-specified.html http://thelivecycle.blogspot.com/2009/11/save-form-to-specific-directories-and.html

    Thank you!

    Lol this is the part that you need as a script to the folder level:

    var lcbSaveAs = app.trustedFunction (function (vDoc, vPath) {}

    app.beginPriv ();

    vDoc.saveAs ({cPath: vPath});

    app.endPriv ();

    });

    This is the code you use in your file:

    lcbSaveAs (, "/ C/users/specialisee1/Desktop/result /" + this.getField("FirstName").valueAsString + "" + this.getField("LastName").valueAsString + "Application.pdf");

    lcbSaveAs is the name of the function of trust.

    vDoc.saveAs is the Document object, call the saveAs method.

    I don't know what oDoc.SaveAs is, or where you got it.

  • Need a simple script, I think.

    I just created a document merged 500 + page [first time use datamerge - coolio] but now need to apply a color swatch in image in grayscale (a QR code) on each page. I could convert all the K in CMYK files, triple the file size of graphics 2700 and undergo an inelegant solution OR ask someone to help me with a simple applescript to do the same thing... unless there is another way to do that I did not understand.

    I have NO experience of script and don't have time to learn it for this project. Anyone feeling the generosity of the season and willing to point me in the right lane?

    Thanks in advance.

    Jessica

    [CS5 on Mac 10.5.8]

    Here you are.

    In the first line, you should put your name instead of 'Gray' to swatch. Copy, and then save it as plain text (if you are using TextEdit on Mac, select present first in the Format menu) in your folder users Script as "MakeAllGraphicsGrey.jsx". Double click to run and sit.

    var swatch = app.activeDocument.swatches.item("Gray");
    for (var i=0; i
    

    Here's a before (left) and after (right) photo to show this works axually.

    (Jongware posing with his new tattoo).

  • I need help with script of 'Edit arc' Russell Brown

    Hello

    I installed the script of 'Edit arc' Russell Brown for CS6. It does not play right. I go to the window > Extensions > edit in an ARC and choosing a layer to run the script. I then run the script. the layer converts it to a smart object and opens in the CRA. I treat layer in an ARC and choose 'Open' and then when the layer opens this file is smaller that before I was running the script (i.e. If layer a face of a person on this subject face decreased after treatment of CRA.)

    My Adobe Camera Raw preferences are set to automatically open all the tiffs supported. The file is 300 ppi, 8bits.  My settings of the CRA are 8 bits 300 ppi. I also tried to change the settings of the CRA to 16-bit, 300 dpi. I'm on a mac equipped with the trial version of photoshop CS6. I don't know why the layer shrinks. It seems like ARC treats the file to 240 DPI or something. Can anyone help? Thank you.

    I don't have so I can't test this, but I think that if you change the "Adobe ACR Editor.jsx" script that was installed during the installation of the CS6 Panel, you should be able to match the ppi of the cab to your ppi CS6 documents.

    Modify it, you need to do is to comment out or remove the following lines.

    // change image res to match defalut ACR 240
    if( app.activeDocument.resolution != 240 ) {
        var docRes = app.activeDocument.resolution;
        app.activeDocument.resizeImage(undefined, undefined, 240, ResampleMethod.NONE);
    }
    
  • Need help with script to remove audit ASM files

    Hello

    It would be great if someone can provide me with a script to delete the files of audit and trace on ASM files

    Thank you

    Aerts.

    Ed,

    I have a shell script which is run via cron once a week.  Of course, you need to change the location of the trace and audit files.  This script will remove all files .trc and .trm more than 10 days

    #! / bin/bash

    find/u01/app/oracle/diag/rdbms /... dbname... / path-name ' * .trc ' - mtime + 10 - type f-exec rm '{} ';

    find/u01/app/oracle/diag/rdbms /... dbname... / path-name ' * .trm ' - mtime + 10 - type f-exec rm '{} ';

  • Need help with script to find the virtual computer by IP

    Looking for a script that will correspond to the vm to IP, but should be able to find several IPS at the same time.

    I put this together from scripts on the net, which works well to search for a single IP address at a time:

    $match_address = Read-Host "enter the IP address to find."

    Get - VM | %{

    $vmips = $_. Guest.IPAddress

    {foreach ($ip in $vmips)

    If ($ip - as $match_address) {}

    "VM found correspondence address: {0}" f $_. Name

    }

    }

    }

    But would need to be able to enter several IP addresses of different subnets in the $match_address and search script for a match for every ip address.

    Could you please try this?

    function search-VMAssociatedToIP {}

    (param

    $ArrayOfIPToCheck

    )

    {in process

    $VMsAndAssociatedIP = get-view - viewtype 'virtualmachine ' | {foreach-object

    $VM = $_

    $_.guest.net | {foreach-object

    $Net = $_

    $_. IpAddress | {foreach-object

    $IpAddress = $_

    $Output = New-Object-Type PSObject-Prop ([ordered] @ {}

    "VM" = $VM. Name

    "NetworkName" = $Net.Network

    "IP address" = $IpAddress

    })

    Return $Output

    }

    }

    }

    $ArrayOfIPToCheck | {foreach-object

    $IPtoCheck = $_

    $VMsAndAssociatedIP | where {$_.} IpAddress - eq $IPtoCheck} | {foreach-object

    $Output = New-Object-Type PSObject-Prop ([ordered] @ {}

    "IpToCheck" = $IPtoCheck

    'VM' = $_. VM

    "NetworkName" = $_.NetworkName

    'IpAddress' = $_. IpAddress

    })

    Return $Output

    }

    }

    }

    }

    $MyArray = "10.0.33.1","10.0.30.11","10.0.20.11","10.0.32.1".

    Search for VMAssociatedToIP - ArrayOfIPToCheck $MyArray | OGV

    Use a table entry.

    First get the IP addresses of all computers installed correctly (only for virtual machines with VMware tools) virtual based on get - view so the collection will be fast.

    Then compare with the PPE provided as input.

  • Need help java script to make something work

    Is it possible to set fields to fill out in advance by selecting a certain element in a drop-down list of separate?

    Example, I have 3 fields of a document, the first contains a menu drop-down of lets say models of printers, the second field is the number of pages allowed to be printed by the model, the third would be the price per copy plus the volume allowed

    Fall to the low price of Volume by extra

    Model 1 100 10 p

    Model 2 200 20 p

    Model 3 300 30 p

    Model 4 400 40 p

    So if I chose the 3 model in the drop down menu, my Volume poster 300 field and my price per extra copy would show 30 p

    In my mind, this seems like it should be possible, but I don't know where to start. I have no idea about writing java script, so if this is the solution I need some advice please

    Thank you

    Jackie

    Yes, it is possible. It is a good place to learn how do:

    https://acrobatusers.com/tutorials/change_another_field

  • Need help more script

    [I'll post it on the forum Google Group too.]

    File is here: https://Acrobat.com/#d=m7zuQYiUoFrtz5isD7rErQ

    Form is a series of paintings that can increase and shrinking their respective lines by clicking a button in the header - tables initially collapsed and filling can open the appropriate tables. I use + and - values on the buttons to see what they should do – they call a script object that manages a loop through the rows in the table, etc. (thank you Niall!).

    I also put similar loops in place on the pre-publication and events docReady (on the root of form1) so that tables collapse down to only use lines for printing or after the form is saved and reopened.

    I have a few questions that I can't understand. I think that some of the problems might even have to do with the events, I'm using, but not sure.

    Reset the value of the key in the header lines + /:

    Unless a table is extended and has empty rows showing I want to the caption of the button to be a +. I tried to explicitly set cela under different loops but seem to have questions.

    Problem with repetition legend header button:

    If a table breaks across a page, the button in the repeat header row does not reflect the caption of the button in the header of the parent line. I sort of fixed this with a code of Paul Guerett that sets the caption based on xfa.layout.pageSpan and it works, but if you click on the button repeated again to reduce the table legend of the main button is not kept up-to-date (must restore a +), unless you click the main button.

    Is related to this one once the file is saved and reopened table headers that had been repeated at random several times (2-5 in general).

    I also ran into some trouble with drive when using Unicode characters for the caption of the button. Instead of +/-, I tried to use \u25BC and \u25B2 (downwards and upwards of triangles), but reader seemed to choke on it.

    This form is ready to go with the exception of these two questions that I can't find.

    Hi Jono,

    Here is the form with a few mods: https://acrobat.com/#d=rXwdoCcfDC0pWQz-39KWjg

    Regarding the extensible headers, I think that the main problem is that the HeaderRow has been set to repeat in the object > tab link. I deselected it. However, you need to test. I have seen this before, and to recover I wrapped the header in a separate subform. I won't do it here because of scripting, but see how you go.

    On the reset button, I've included an execEvent for the docReady event in the form1 node. This resets him ' + '.

    When a table spans several pages (generating another '-' button). I've included another line to reset the original button toward "+":

    xfa.resolveNode("HeaderRow[0].Button1.caption.value.#text").value = "+";
    

    It seems to work.

    I have not watched the Unicode. I would stick with the + /, as these are self evident and you will be less likely to have compatibility problems.

    Shape looks good!

    Good luck

    Niall

  • Newbie needs help w / script revision



    So, I created a slide show, where each image is a link. I have selected _blank in the selection of the window. I would like to change that to _parent. Problem is that I can't find the script! Seems that the actions are associated with the instance. And I can not find them in order to change the action. Help?

    Use the movie Explorer. It is in the Windows menu.

    When loading, you can refine what it shows by using the icons at the top. For Actionscript, this is the icon with the arrow. To change a particular frame, you can double-click the name of the image or the code then it will open the actionscript Panel.

  • Need help w / Script Groovy (Jet lag)

    I'm writing a script groovy/function which displays the difference (DD:HH:MM:SS) between two dates (now rather than a time of inputt'ed).

    I run the following script, which seems like it should work, but I get the error referenced below: DATEVAL is an input value.  Any idea?

    import groovy.time. *.

    def now = new Date()

    TimeDuration duration = TimeCategory.minus (now, dateValue)

    length of back

    Error:

    the value returned by the Script: "the static value of the type: 'groovy.time.TimeDuration' ' is not assignable to the type of the Script output:" foglight-5 - admin:TimeDuration.

    Screenshot:

    change your output type of the object, see what it says to type when you test again.

  • Need help with script to Calc

    I have a requirement as below.

    If has! = #Missing AND B == missing OR C == #Missing

    To copy the last week same value from one day to the current date.

    I've written as below.

    DIFFICULTY ('FY15', 'D01')

    "Qty")

    IF (A! = #MIssing AND (B is #Missing or C == #Missing))

    "Qty" = "D07;

    )

    ENDFIX

    I have to write like that for all the permutations and combinations for all the combination date D1 to D31.

    Is there an elegant way, that everyone knows to do this using variables. Please throw some light on this for me.

    Thank you
    Vishal

    Hi Vishal,

    In this case, you should be able to do it with @PRIORand taking "Days" out of the statement to FIX.  The exact syntax depends on if the "days" are labeled as a time dimension.  If it is marked at the time, the assignment would be:

    "Qty" = @PRIOR ("quantity", 7);

    Because you don't want to cross the borders of the month I guess 'D01' through "D07" will always end up #Missing.

  • Need help with script debugging - images not showing

    Hello

    I practice with little javascript for a rotating banner.  It works on my local copy, but when I download it will not display.  I also added a photo in the 'body' and it shows, so I compared the paths, and they seem correct.

    the page is here

    what Miss me?

    I got the code here:

    http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

    Thank you

    Ziggy

    ... /images/banner_1.jpg

    Remove the part highlighted for each image. This will allow search for the image as in

    http://ziggystout.com/flg_test/images/banner_1.jpg

    When you test the link, I see that banner_2.jpg and banner_3.jpg are found at this place, but the other two images are not here.

    Please ensure that you have downloaded the missing images or that they have the correct name and extension.

  • Need help with script cal on CCONV

    Hi all experts,

    I installed the database of currency and it works fine, but when I tried to get the rate dynamically based on 'Year' and 'Version', I got syntax error, here is my code.


    UPDATECALC OFF SET;

    DATACOPY RPTValue to USDValue;
    Fix ("USDValue")
    CCONV @MEMBER (@CONCATENATE (@NAME (@CURRMBR ("Year")), @NAME (@CURRMBR ('Version')))-> "USD";
    ENDFIX;

    CALC ALL;

    In my database of currency, the currency has been defined as "(2010Act, 2010Bud, 2011Act, 2011Bud, etc.), it's because we have different rates by year and version."

    Thanks for any recommendations

    Billy

    You must link your PL database to database of currency for that... OK such me how can we achieve... Send me by e-mail

    [email protected] we will do together

  • Need help with understanding PowerCli scripting by LucD

    Hello

    I'll give you the standard statement that I am a noob powercli and don't really know what I'm doing here.  Here's a script that works because it runs without error and gives a report but I need help to understand this under his weight.

    Connect-VIServer '< our vcenter >' - user < user > admin-password < admin-user-pwd >

    $allvms = @)

    $vms = get - Vm | where {$_.} PowerState - eq "Receptor"}

    $start = (get-Date). AddDays(-1)

    $metrics = "mem.usage.average".

    $stats = get-Stat-entity $vms - start $start - Stat $metrics

    $stats | Group-object - property {$_.} Timestamp.Day}, {$_.} @entity.name} | %{

    $vmstat = "" | Select the day, MemAlloc, MemMin, MemMax, MemAvg, VmName

    $vmstat. VmName = $_. Values [1]

    $vmstat. Day = $_. Group [0]. Timestamp.Date

    $mem = $_. Group | where {$_.} MetricId - eq "mem.usage.average"} | Measure-object-property value - average - Maximum - Minimum

    $vmstat. MemMax = [int] $mem. Maximum ##dfsdf

    $vmstat. MemAvg = [int] $mem. Average

    $vmstat. MemMin = [int] $mem. Minimum

    $vmstat. MemAlloc = $_. Group [0]. Entity.MemoryMB

    $allvms += $vmstat

    }

    $allvms |

    Export-Csv "c:\ < folder > \ <>.csv file Destination"-noTypeInformation

    It connects to our server vcenter server and offers two days of data.  Today and yesterday, all with a timestamp of 0:00.  See below for an example of a virtual machine.

    VmNameDayMemAllocMemMaxMemAvgMemMin
    < name VM1 >07/05/2016 0:004096181818
    < name VM1 >06/05/2016 0:0040963612

    8

    The MemMax, the MemAvg and the MemMin are for this day?  Just the max of this period of sampling time 0:00?

    What I'm looking for, it is to find that the use of the maximum memory of virtual machines are for the whole day.  So I hope that I can remove memory of VMs that do not use it.  I was listed on the change $start = (Get-Date). The value of AddDays(-1) to $start = (Get-Date). AddDays(-30) and see what things alike.  I want to be sure however that the value for MemMax is the highest value for a period of 24 hours.  That is to say for the 07/05/2016 the given virtual machine never used a maximum of 18% of his memory attributed the 06/05/2016 the maximum amount of memory used was 36%, and so on that I extend on the date range.

    Kind regards

    Michael

    It then becomes a rather simple Get-Stat script.

    $vms = get - Vm | where {$_.} PowerState - eq "Receptor"}

    $start = (get-Date). AddDays(-1)

    $metrics = "mem.usage.average".

    Get-Stat - entity $vms - start $start - Stat $metrics |

    Select Timestamp,@{N='VM'; E={$_. @entity.name}}, Value |

    Tri-objet-VM property |

    Export-Csv "c:\------.csv '-noTypeInformation

Maybe you are looking for