help with bulk - update script vcloud Org

Hi all

I need to update the following script to edit only all VMs in a single body... I don't want to touch to all environments...

ForEach ($vm in (Get - VM)) {}

$vmv = get - VM $vm | Get-View

$name = $vmv. Name

$guestid = $vmv. Summary.Config.GuestId

$vmx = new-Object VMware.Vim.VirtualMachineConfigSpec

$vmx.extraConfig += new-Object VMware.Vim.OptionValue

$vmx.extraConfig [0] .key = "monitor_control.enable_softResetClearTSC."

$vmx.extraConfig [0] .value = 'TRUE '.

If ($guestid - like ' windows8 * Guest ') {}

($vmv). ReconfigVM_Task ($vmx)

}

}

When I connect to the specified by connect-ciserver-Server xxxx - Org Org MyOrg and test, it tells me:

Get - VM: 09/05/2016 15:40 Get - VM you are not currently connected

on all servers. Sign in first with a cmdlet Connect.

C:\scripts\TSCClear.ps1:1 char: 18

+ ForEach ($vm in (Get - VM)) {}

+                  ~~~~~~

+ CategoryInfo: ResourceUnavailable: (:)) [Get - VM], ViServerConne)

ctionException

+ FullyQualifiedErrorId: Core_BaseCmdlet_NotConnectedError, VMware.VimAuto

mation.ViCore.Cmdlets.Commands.GetVM

Not a script guru here, just trying to see if I can make this work in an Org with some modifications

You get the error message because the cmdlet Get - VM work, you must be connected to a vCenter server. For the ReconfigVM_Task() method, you must be connected to a server vCenter as well. The following PowerCLI script connects to both a vCloud Director Server and vCenter server. The script uses the cmdlet Get-CIVM to recover virtual machines in the organization. Because the VirtualmachineConfigSpec is the same for each virtual machine, I took it out of the loop to make the script run faster.

$Organization = 'MyOrg ".

$CIServer = "vCloudDirectorServer".

$VIServer = "vCenterServer".

Connect-CIServer-Server $CIServer

SE connect-VIServer-Server $VIServer

$vmx = new-Object VMware.Vim.VirtualMachineConfigSpec

$vmx.extraConfig += new-Object VMware.Vim.OptionValue

$vmx.extraConfig [0] .key = "monitor_control.enable_softResetClearTSC."

$vmx.extraConfig [0] .value = 'TRUE '.

ForEach ($vmv in (Get-View - RelatedObject (Get-CIVM - Org $Organization). ExtensionData)) {}

$name = $vmv. Name

$guestid = $vmv. Summary.Config.GuestId

If ($guestid - like ' windows8 * Guest ') {}

($vmv). ReconfigVM_Task ($vmx)

}

}

Tags: VMware

Similar Questions

  • need help with the Update statement

    Hello
    I received a question in a course and I tried my best to respond, and now my brain is giving. I would really appreciate help with the update statement. I don't mind if you do not validate a solution, a little nudge in the right direction would be really useful. I'll post that I got.

    THE QUESTION
    / * For these agents disabled on more than seven missions, change their date of deactivation of the first date of deactivation of all the agents that have been activated in the same year as the agent that you update currently.
    */

    I have it divided into parts, here is my select statement to agents disabled on more than 7 missions, which produces the deactivation_dates in the agents table that I want to update...
    SELECT
    s.deactivation_date
    FROM
    (
    SELECT
    a.deactivation_date,
    count(m.mission_id) as nomissions
    FROM
    agents a
    INNER JOIN
    missions_agents m
    on
    a.agent_id=m.agent_id
    GROUP BY
    a.deactivation_date
    ) s
    WHERE
    s.nomissions>7 AND s.deactivation_date IS NOT NULL
    .. .and the code for the first date of deactivation for each year of activation agent
    select 
    a2.deactivation_date
    from
    agents a2
    where a2.deactivation_date= 
    (
    select min(a.deactivation_date)
    from 
    agents a
    where to_number(to_char(a.activation_date,'YYYY'))=to_number(to_char(a2.activation_date,'YYYY'))
    )
    ..... I am not real to marry these two statements together in the Update statement. I can't extract each date of deactivation produced in the first select statement and their match against the first date of deactivation in the year they have been activated for the second select statement.

    Any help greatly appreciated... :))

    I began to wonder how things would :)

    user8695469 wrote:
    First of all why he chooses the date the earliest of all agents

    UPDATE  AGENTS_COPY AC /* (1) */
    SET     DEACTIVATION_DATE = (
    SELECT  MIN(AGS.DEACTIVATION_DATE)
    FROM    AGENTS_COPY  AGS
    ,       AGENTS_COPY AC /* (2) */
    WHERE   TRUNC(AGS.ACTIVATION_DATE,'YEAR') = TRUNC(AC.ACTIVATION_DATE,'YEAR') /* (3) */
    )
    

    He recovers as soon as the subquery has not been correctly set in the SET clause. It seems you are trying to update a correlated, but we are still having a conceptual shift. I have added a few comments to your code above and below will explain.

    (1): when you do a correlated update it is useful to the table alias that you did right here.

    (2): this table statement is not necessary and is the reason why the FIRST deactivation date is selected. The alias that you use (3) refers to THIS table, not the one defined in the update statement. Remove the line indicated by (2) in the FROM clause and a correlated update will happen.

    and secondly why is it to update each row, when I thought that I'm just the lines where the agents are disabled and missions > 7? Pointers on where I'm wrong would be very appreciated. (SQL = stupid query language!) :)

    user8695469 wrote: then why is it to update each row, when I thought that I'm just the lines where the agents are disabled and missions > 7? Pointers on where I'm wrong would be very appreciated. (SQL = stupid query language!) :)

    
    WHERE EXISTS
    (
    SELECT
    a.agent_id,
    count(m.mission_id)
    FROM
    agents a
    /* INNER JOIN AC ON AC.AGENT_ID = A.AGENT_ID */
    INNER JOIN
    missions_agents m
    ON
    a.agent_id=m.agent_id
    GROUP BY
    a.agent_id,
    a.deactivation_date
    HAVING
    count(m.mission_id)>7 AND a.deactivation_date IS NOT NULL
    )
    

    Once again this problem is similar to the question above that a correlation update doesn't work. Test existence of lines in an EXISTS subquery. Since your subquery is not related to the table that you are trying to update, it will be always return a line and, therefore, it returns true for EACH LINE in the AGENTS table. To limit the game to only agents > 7 missions results, you need to add a join condition that references the table in your update statement. I added one above (with comments) as a sample.

    I recommend you look over all material that you have associated with correlated subqueries, including documents that I posted above. This seems to be what you're having the problem more with. If you need me to explain the concept of correlated queries any better please let me know.

    Thank you!

  • Problem with the Update Script

    I'm trying to update a column in the database with the following script, but still get errors on the ORA-00904: "CUSTOMER_CONTACT_NRD." "" "" ACTIVE ": identifier not valid, even thought it must be fair.
    In the end, I want to update the table like that, but first test it on a single customer.
    Are the media may not play directly, or am I missing something else?

    Update v_contact v1
    set
    (v1.inactive_contact) = - 1
    where (v1.cust_id =
    customer_contact_nrd.customer_id and v1.contact_no =
    customer_contact_nrd.contact_no and customer_contact_nrd.active = n
    and v1.cust_id = 106586)

    Thank you for your help.

    Published by: mcramer on October 26, 2009 12:38

    Try something like this...

    Update v_contract v1
    Set v1.inactive_contact = - 1
    where v1.cust_id in
    (by selecting v1.cust_id in customer_contact_nrd v3
    where v1.cust_id = v3.customer_id
    and v1.contact_no = v3.contact_no
    and v3.active = ' n and v1.cust_id = 106586)

    or read this...
    http://www.jlcomp.demon.co.UK/FAQ/lost_update.html

  • Help with the Powershell script to collect logs from all domain controllers

    I am writing a script to retrieve the last 5 days of application, security and log files from all domain controllers. The script runs, but fire the logs from the local server only. The variable $Computer has all of my DC so it's the fine mark. I guess it's a problem with my line ForEach-Object, but is not error. See the below script.

    $log = 'application '.
    $date = get-date-format MM-DD-YYYY
    $now = get-date
    $subtractDays = new-object System.TimeSpan 5,0,0,0,0
    $then = $Now.Subtract ($subtractDays)
    $Computers = get-ADDomainController-filter *.
    ForEach-Object - InputObject $Computers - process {Get-EventLog - LogName $log - after $then - before $now - EntryType error | select EventID, MachineName, Message, Source, TimeGenerated |} ConvertTo-html | {Out-file $env:TEMP\Applicationlog.htm}
    Invoke-Expression $env:TEMP\Applicationlog.htm

    Thank you

    Rich

    Hello

    To help with the repost the question script to the script Center Forum

    http://social.technet.Microsoft.com/forums/scriptcenter/en-us/home

  • need help with windows update C8000F1A error code

    I need help with an error code that is given to my PC when I try to put up-to-date

    Hello

    1. don't you make recent changes?

    2. This does happen with any special updates or all updates?

    I suggest you to follow these steps and check if that helps:

    Method 1:

    If you have installed a security software on the computer, then I suggest you try to disable temporary and check to see if the same problem happens. Make sure that you enable security software back once the diagnosis is made to prevent the computer from virus attacks.
    http://Windows.Microsoft.com/en-us/Windows-Vista/disable-antivirus-software

    Method 2:
    I suggest you follow the steps in the link below and check if it helps:
    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-installing-updates

    It will be useful.

  • Need help with the update of Windows (OS-Windows 7)

    Hello world

    Recently, I met a problem with Windows update on my laptop (OS-Windows 7). Everything is fine with it, but when I try to install updates (recommended or optional) window says that it downloads the updates, but the progress remains to 0KB and 0% downloaded status. I tried to restart the service of windows update with utility update of windows running, but without success. However, I was able to install updates, most of them associated with Microsoft.NET framework 3.5.1 (I'm not sure of the version of the .NET Framework is installed in my computer). But when I tried to install other updates updated security windows or .NET Framework 4. XX version update, he gave the same answer that I mentioned above.

    I can give my specifications and other information required if necessary.

    Please help me with this problem about the update of windows.

    Thanks for your time and your help.

    Try the following: set never 'Find updates' automatic updates and then restart Windows. Download and install KB3161608.

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

    Best regards, VZ

  • Hi, I need help with installing updates for CS5

    Hi, I need help with the installation of the updates of CS5. I get the following message: some updates to installation failure. My product is already registered. Can someone help me, please?

    Erkan please download and apply updates directly from updates.

  • Help with software updates for HP Officejet Pro L7500 Series

    Five updates have been identified as available when I used 'check the software updates' Solution Center.

    All updates failed to download. The updates are:

    Update critical HP product Assistant

    Critical update for HP memories disc creator

    HP update - security update

    Updated HP 4.0.12

    Update recommended to correct a problem with the sign up now product registration page

    TDA, since these updates are not required for your system and your printer that updates could not be installed on your system, however if you want to see what updates are available, then this is the web page to select your printer model, and then select your operating system and you can see the updates you need to update for your printer :

    link to select your printer model

    Once you click on the link above, you must click your series of model and then in the next page, click on drivers and software download link to see available software for your printer.

    Hope this helps you.

  • Portege Z835 - need help with BIOS update

    Hello.

    I have a Portege Z835, with a battery problem: do not load. The battery indicator says "3% connected load" but it doesn't load the battery.

    Some forums said that the solution is updating the Bios. I have a Bios Update v.1.60 ready to install. When I try to install, we get the message "the battery power is not enough.

    My power cord is still connected. If I unplug the power cord, the laptop is turned off.

    Please, what can I do?

    Thank you.

    F.

    To be honest I don't think it's the related issue of the BIOS. AFAIK battery must be charged, even if the laptop is turned OFF so why BIOS update if the battery can not be charged at all.

    To me that sounds like hardware related issue.

    How old is your Portege?
    Warranty is still valid?

    Maybe you should contact Toshiba service and ask for help or even their opinion.

  • Help with Pages (updated)

    Hi, is it possible to recover a project of Pages? I spent hours writing a poem, and when I went to edit this morning it wasn't in my docs. (I feel sick to the loss). I can't find a drafts folder. Pages save drafts? And if so where can I find the? Any help appreciated. Thank you

    Update, I found an older version that was attached to another poem. I opened the other poem, press "file" at the top left, then back to all versions and recovered my work. Yes! Yet, if it had not been attached to another page would be recoverable? Or are not registered treaties lost forever? Thank you.

    The first thing that you should incorporate as a habit , it is that when you start a new document, immediately save with a name explicitly, on your local drive and in a memorable folder location. Now, three things will happen.

    1. Automatic backup pages begins, and about every 10-15 seconds, your content is updated every time that it has been saved. If you leave the page, it will be perrform a last record automatic, just before it closes. Auto-save will automatically resume on subsequent changes to the document.
    2. You have an auto-sauve document captured every hour by Time Machine.
    3. You can locate your document again.

    Pages has an automatic backup folder location that may have a copy of work-in-progress of your document until you exit Pages. Pages can also keep temporary files related to your Pages session buried in a system location that is basically inaccessible and not designed for user access.

  • Need help with windows update please!

    Tried for months now to get windows update to work properly. I still see a message pop up in my lower toolbar, that says: windows cannot verify the updates, with a red x. I'll try to update manually and it shows 0% all the time. When I go and check to see if there have been updated, it will show a little from time to time, who have downloaded successfully, but believe that is made during a unrolled task he is set to make only 1 or two from time to time will show. I don't know what else to do. It's Windows Vista. Help, please... My Windows defender seems to fine day. Help, please... Thank you...

    Hello

    I guess that part of the question could be a driver which is really old or similar should not be loaded.

    This exit Windows updates on (after you have access) and stop the updates of the driver to load.

    How to disable automatic driver Installation in Windows Vista - drivers
    http://www.AddictiveTips.com/Windows-Tips/how-to-disable-automatic-driver-installation-in-Windows-Vista/
    http://TechNet.Microsoft.com/en-us/library/cc730606 (WS.10) .aspx

    ---------------------------------------------------

    You can use the solutions in this KB - 3 methods and I listed a little help for them below

    The update is not installed successfully, you receive a message, and the computer restarts when you try to
    install an update in Windows Vista
    http://support.Microsoft.com/kb/949358

    Method 1: Start Windows Vista with the Windows installation media and use the repair feature

    How to do a startup repair in Vista
    http://www.Vistax64.com/tutorials/91467-startup-repair.html

    You can also do a safe mode startup repair to access the Recovery Options If you have them available
    or use the DVD as described above.

    This tells you how to access the System Recovery Options
    http://windowshelp.Microsoft.com/Windows/en-us/help/326b756b-1601-435e-99D0-1585439470351033.mspx

    Try recovery options Startup Repair

    How to do a startup repair
    http://www.Vistax64.com/tutorials/91467-startup-repair.html

    Method 2: Start the system in safe mode and then use the system restore feature

    How to make a Vista system restore
    http://www.Vistax64.com/tutorials/76905-System-Restore-how.html

    You can also do a restore of the system of starting with a Vista disk.

    Method 3: Rename the Pending.xml file, and then change the registry (this method is part of the advanced troubleshooting)

    See article below for that.

    You can use this method on the updates that have this problem.
    http://support.Microsoft.com/kb/949358

    Hide the update (click right - HIDE in the updates of Windows) and go to the Microsoft Download Center to download
    and install it.

    Microsoft Download Center
    http://www.Microsoft.com/downloads/en/default.aspx

    ------------------------------------------------------

    Once you are in Windows I was running once again reset here as a precaution.

    How to reset the Windows Update components?
    http://support.Microsoft.com/kb/971058

    Hope this helps sort it out for you.
    Rob - bicycle - Mark Twain said it is good.

  • help with windows update errors and chkdsk

    I got a message saying I needed to update my windows.  I went to windows update, the express settled.  I received a message that says that I can't install the update to windows.  This is the message I received:

    The website has encountered a problem and cannot display the page you are trying to view. Take the following steps to try to resolve the problem:

    • Refresh the page.
    • In Internet Explorer, delete the temporary Internet files by going to the Tools menu and then Internet Options.
    • Close and then reopen Internet Explorer.

    Then I'm defragmenting my "C" drive and I get an error with the States: Please run chkdsk /f.  I run that, once it goes through the whole process, I will return to defragment and I STILL get the same message.  I don't know how to clear these while I am able to update and to defragment my system.

    Thank you for your help

    Hello

    You can try the troubleshooting provided in the link below steps to fix the problem.

    You receive an error message "0x800A01AE" or a "0 x 080070570" error message when you try to connect to the Windows Update Web page or to the Microsoft Update Web page in Windows Server 2003 or Windows XP

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

    See also:

    You may encounter temporary connection related errors when you use Windows Update or Microsoft Update to install updates

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

  • Help with Windows Update error 80070026

    Hello, new here, but really need some advice or help...
    For some reasonI cannot get to my updates.  Everyway that I try to run my automatic updates for windows I get an instant error with the error Code 80070026.  I am running Vista with service pack 1 and my last successful update was in November.  I do not know there is an update for me who keeps my computer at risk or with this problem.  Advice or assistance on the issue would be greatly appreciated.

    -----

  • need help with windows update failures

    I'm really becoming disillusioned and anrgy. In the last 5 weeks or so I installed Windows 7 on at least 11 PCs,... and in all cases, bar 1, I am facing the same problem. I use the Start button, windows update to check for updates after a new installation, sometimes in a few seconds, I get the red error message, other times the normal practice of verification of updates begins. Invariably, nothing happens except the window Windows Update appears to 'disappear' or forget it works, so I start it again, wait forever and finally get the Red writes the error message. I tried the windows online and offline "Fixit and the right sequence is repeated continuously." Yesterday morning at 04:00 [if there are 36 hours] I completed a new installation, over the next 24 hours, I have to have rebooted and retried the windows update at least 4 times. I also tried a couple of different ' FixIt. This morning, becoming almost ready to... Yet once, I tried to use the updates. He did what he normally does... the scan, check... check... NOPE! nothing for you. So I tried the specific 'fixit' MicrosoftFixit.wu.LB.7235772074748435.1.1.Run it tooks ages and ages to complete... but once it was over, no changes because no errors not found. Immediately, I opened windows update via the Start button, click on check for updates... and immediately got written red error with updates. [Screenshots have been taken, timestamped in the seconds between them showing the previous references].

    Can someone help me? Why is - this all of a sudden becomes a common problem? Each PC I put back nine have different configurations, my wireless network has no problem with updates from the manufacturer's websites... SO, WHY THIS ISSUE FROM MICROSOFT?

    It is expected by M$, we must now jump through hoops to clean install.

    http://www.ZDNet.com/article/sticking-with-Windows-7-the-forecast-calls-for-pain/

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-update/Windows-Update-remains-at-checking-for-updates/ff3c442e-79a6-40d3-AC35-29e130cebef1

  • Need help with the update for my 11 elements

    I have 11 items and just switch to the Canon 7 d Markii and shooting in RAW for the first time last night and the editor and organizer elements does not files because it does not acknowledge the BRUTE of the 'new '... device information I tried the update and he offered only a 7.4 update, where the 7 5 d Markii must at least a 8.7 update... How can I get the latest update if my program does not by itself? I DON'T like the way Canon program from the disk provided with the camera is set for RAW images, and I don't want to have to change all the RAW files to only align my items... I enjoyed how the older my camera RAW files were brought in Editor with the pop-up window which allow me to make changes to quick for photos before opening them in the editor... Yet once I don't like how the Canon window works for RAW images... Thanks for any help on this... Nicole

    Camera Raw 8.7 was introduced in PSE13. If your software is too old to be compatible. Yu have two choices:

    1. Upgrade to the latest version PSE14
    2. Converting your CR2 for Adobe (DNG) Raw and DNG files will work with PSE11

    The Adobe's DNG Converter is free, and you can batch process all of a file CR2 by selecting a source folder and destination folder.

    Download the latest DNG Converter 9.6.1 Mac | Win

Maybe you are looking for

  • I can re - organize email accounts in the Inbox?

    I have several email accounts and would like to have those that I use the above.

  • Satellite L350-170 does not restart after cancellation of HARD drive recovery

    I tried to restore using the hard drive option but then change your mind so I click on the Cancel button.He returned to the toshiba logo screen, then a screen came to say the start menu at the top and underneath it says I use the restore disc to inst

  • Want to reinstall Vista

    I have my laptop with Vista but I installed Windows XP in there, now I want to install windows Vista again until I doHow to recover my old vista or tell me another way to solve this problem?

  • help for chkdsk e250

    Well, here I am once more need help... I have an e250 (v1 if that helps any...), and when I added a lot of songs, one day, I started to have duplicates of songs that were already on my drive and both channels worked, so I decided to remove them manua

  • No sound from Internet Explorer / Sound of ok media with USB speakers player and without.

    Please can someone help... I am running Vista Home premium on a Toshiba Satellite Pro A200 series. I ran diagnostics and any other thing, I see... I can get good sound play anything through Media Player... But no Internet Explorer sounds... makes no