Adding notes to some VM in a folder

I need to add a description in the field notes of vm... the script will query a data center and export the vm name and the name of the file in a csv file, of what folder is it will enter the description. The issue I'm having is that it annotera the description of the virtual machine to the folder structure of higher level instead of the specified folder.

#Specifies which folder to target for pulling of Virtual Machines
$JPfolder = get-datacenter "LifePoint Hospitals" | get-folder "ITS-Information Technology" 
 
#Sets a Folder Variable
$Folder = "Test Machines"
 
#Sets a Note Variable
$note = "TEST BOX"
 
#Gets a list of Virtual Machines within the Folder that was identified before and assigns to a variable
$VMlist = get-vm -location $jpfolder
 
#Gets the VM's based on the variable from before and iterates through exporting them to a CSV with the relevant columns
Get-VM $vmlist | select Name,@{N="Folder";E={$_.Folder.Name}} | `
Export-Csv "C:\vm-folder.csv" -NoTypeInformation -UseCulture
 
 
#Imports the CSV created earlier and does a foreach with an IF switch to do the Set-VM Action
Import-Csv "C:\vm-folder.csv" -UseCulture | %{
    If ($_.Folder -eq $Folder)
                                {Set-vm -vm $vmlist -Description $note -Confirm:$false}
 
}


OK, it works

Try it now like this

#Specifies which folder to target for pulling of Virtual Machines
$JPfolder = Get-Datacenter "LifePoint Hospitals" | Get-Folder "ITS-Information Technology" 

#Sets a Folder Variable
$Folder = "Test Machines" 

#Sets a Note Variable
$note = "TEST BOX" 

#Gets a list of Virtual Machines within the Folder that was identified before and assigns to a variable
$VMlist = Get-VM -Location $jpfolder 

#Gets the VM's based on the variable from before and iterates through exporting them to a CSV with the relevant columns
$VMlist | select Name,@{N="Folder";E={$_.Folder.Name}} |
Export-Csv "C:\vm-folder.csv" -NoTypeInformation -UseCulture 

$VMlist = Import-Csv "C:\vm-folder.csv" -UseCulture 

#Change the Note field for all VMs in folder $Folder
$VMlist | Where {$_.Folder -eq $Folder} | %{
    Set-vm -VM $_.Name -Description $note -Confirm:$false}

Tags: VMware

Similar Questions

  • When I try to delete the message in the "Deleted items" folder I get an error message "some items in the folder"Deleted items"could not be deleted." year error has occurred. Any Suggestions?

    I get to see all the messages that I deleted in my "Deleted items" folder and when I try to delete the message in this folder I get an error message 'some items in the folder "Deleted items" can not be deleted.' an error has occurred.  Also when I try to delete my Inbox it won't move message from 'deleted items '.  Any suggestions?

    This is probably due to a mismatch between what is in the message store and which think that the database is in the message store.  Try to compact and repair the database and see if that fixes the problem.  See www.oehelp.com/WMUtil/

    Steve

  • Mac will not load some web pages but works in safe mode

    Hello

    I am trying to solve the following problem...

    MacBook Pro with 10.11.3 will not load some web pages (booking.com people.com are just a few). Browser will not make a difference.

    Looked around the discussions and tried a few remedies but without success. for example, change the dns data, site reset or 8.8.8.8.8 create a new user and I have tried several different networks.

    All the site will load in safe mode.

    Thank you guys!

    If they load in Safe Mode, then it is a third-party plug-in or software blocking sites while not in Safe Mode.

    Do you have the third-party antivirus or firewall? Do you have any unknown third party plugins or extensions?

    Open the Finder, click go > go to folder, copy and paste the following and click on Go

    ~/Library/Internet plug-Ins

    This is where your plug-in user. By default, this folder must be completely empty, so anything here has been added either by you or with 3rd party software that has been installed. You can move anything in this folder on the desktop and then try with your sites. If this works, your choice in their folder one by one until it doesn't. Remove the problem and it redownload only if you really need.

  • Outlook Express - my sent messages are not appearing in my "Sent items" folder.

    E-mails are not appearing in my "Sent items" folder  How can I fix it?

    Tools | Options | Send. Is the ability to save a copy in sent items checked? If it is already, you have corruption of dbx files.
     
     
    Spend most of your messages out of the Inbox and then create new folders to send and sent items box after having moved the messages you want to save to a local folder that you create.
     
    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.
     
    In Windows XP, Win2K & Win2K3 the OE user files (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder Options icon | Opinion, or in Windows Explorer. Tools | Folder options | View.
     
    With OE closed, find the DBX files for the items in the Outbox and sent and delete them.  New ones will be created automatically when you open OE.
     
    After you're done, followed by compacting your folders manually while working * off * and do it often.
     
    Click Outlook Express at the top of the the folder tree so no folders are open. Then: File | Work offline (or double-click on work online in the status bar). File | Folder | Compact all folders. Don't touch anything until the compacting is completed.
     
    General precautions for Outlook Express:
     
    Do not archive mail in the receipt or sent items box. Create your own user-defined folders and move messages you want to put in them. Empty the deleted items folder daily. Although the dbx files have a theoretical capacity of 2 GB, I recommend all a 300 MB max for less risk of corruption.
     
    Information on the maximum size of the .dbx files that are used by Outlook Express:
    http://support.Microsoft.com/?kbid=903095
     
    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the CPUs, slows down sending and receiving and causes a multitude of problems such as time-outs, account setting changes and has even been responsible for the loss of messages. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3 
     
    Why you don't need your anti-virus to scan your email
    http://thundercloud.NET/infoave/tutorials/email-scanning/index.htm
     
    Note that for some AV programs, it may be necessary to uninstall the program and reinstall in custom Mode and uncheck analysis when the option is the result of e-mail messages.
     
    Compact often as specified above.
     
    And backup often.
     
    Outlook Express Quick Backup (OEQB Freeware)
    http://www.oehelp.com/OEBackup/default.aspx 
  • Outlook Express 6 problem: send an email I get an error message and the email is not put in the sent items folder

    Outlook Express 6, Windows XP SP 3

    Problem: send an email, I get an error message and the email is not put in the sent items folder while the email (and attachments, if any) are successfully delivered to the recipient.

    The full error message is always useful, but I'm sure you have damaged dbx files.

    Spend most of your messages out of the Inbox and then create new folders to send and sent items box after having moved the messages you want to save to a local folder that you create.

    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.

    In Windows XP, Win2K & Win2K3 the OE user files (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder Options icon | Opinion, or in Windows Explorer. Tools | Folder options | View.

    With OE closed, find the DBX files for the items in the Outbox and sent and delete them.  New ones will be created automatically when you open OE.

    After you're done, followed by compacting your folders manually while working * off * and do it often.

    Click Outlook Express at the top of the the folder tree so no folders are open. Then: File | Work offline (or double-click on work online in the status bar). File | Folder | Compact all folders. Don't touch anything until the compacting is completed.

    General precautions for Outlook Express:

    Do not archive mail in the receipt or sent items box. Create your own user-defined folders and move messages you want to put in them. Empty the deleted items folder daily. Although the dbx files have a theoretical capacity of 2 GB, I recommend all a 300 MB max for less risk of corruption.

    Information on the maximum size of the .dbx files that are used by Outlook Express:
    http://support.Microsoft.com/?kbid=903095

    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the CPUs, slows down sending and receiving and causes a multitude of problems such as time-outs, account setting changes and has even been responsible for the loss of messages. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3

    Why you don't need your anti-virus to scan your email
    http://thundercloud.NET/infoave/tutorials/email-scanning/index.htm

    Note that for some AV programs, it may be necessary to uninstall the program and reinstall in custom Mode and uncheck analysis when the option is the result of e-mail messages.

    Compact often as specified above.

    And backup often.

    Outlook Express Quick Backup (OEQB Freeware)
    http://www.oehelp.com/OEBackup/default.aspx

  • Vista gives the message "there is no more available end point" and does not allow me to share a folder on an external drive. Can you help me?

    Vista gives the message "there is no more available end point" and does not allow me to share a folder on an external drive.  Can you help me?

    Hello

    Thanks for posting in the Microsoft Community.

    I don't know it must be frustrating!

    Let us try these steps and see if that fixes the problem:

    (a) press Windows + R keys to open search Run

    (b) type regedit , and then click ok

    go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BFE

    c) on the right, click it, click permissions

    (d) click on ADD and type everyone and click ok

    (e) now click on all

    (f) below, you have permissions for users, select full control and click ok

    g keys) press Windows + R to open Run Search

    (h) type services.msc , and then click ok

    (i) double-click base filtering engine service.

    (j) Make sure that the service status is started and the startup type is automatic

    (k) the procedure for the windows firewall service

    (l) click on apply and Ok.

    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:

    Back up the registry:

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

    Hope the helps of information. We know if you need help. We will be happy to help you.

  • I'm using wondows mail in windows vista, I created some folders under the folder spam I deleted by mistake, is option there anyway, I can recover those email folders?

    I'm using wondows mail in windows vista, I created some folders under the folder spam I deleted by mistake, is option there anyway, I can recover those email folders?

    Have you checked in the deleted items folder? If they are not there, you will have little luck with this tool.
     
    Search for .eml files.
  • Flash will not play some videos (under vista only!)

    Hello I am puzzled that flash will not play some videos

    (for example from dailymotion.com or canalplus.fr).

    The problem exists with the current version (10,3 r183)

    But if I try to downgrade or with v11 beta...

    On the same machine, I can also boot XP or linux

    where everything works as expected, but no dice on winvista

    (SP2)! I've also updated my nvidia display drivers

    and I tried to disable hardware acceleration and temporarily

    my firewall and my anti-virus, nothing helps.

    I see it with IE7/FF6/Chrome.

    All the operating systems are 32-bit.

    Note that some sites have very well (e.g. youtube)

    Can someone suggest something, please?

    Let's try the following:

    1. Close the browser windows
    2. In Explorer, navigate to the following folder: C:\Users\username\AppData\Roaming\ (the best way to do this is to type %appdata%\microsoft\windows\sendto in the path of the Explorer bar).
    3. Remove the Macromedia folder
    4. Then, go to the Adobe folder and delete the folder 'Flash Player' inside.
    5. Finally, go to "c:\windows\system32\macromed\flash" and look for a file mms.cfg.  If it is present, please rename it.

    Once done, try those sites to reoffend.

    Chris

  • Upgrade to el capitan and hoping to drive DVD would work properly but no, still do not play some of my DVDs. Is there an upgrade available? my library of playable DVD shrinks

    Upgrade to el capitan and hoping to drive DVD would work properly but no, still do not play some of my DVDs. Is there an upgrade available? my library of playable DVD shrinks. IMac originally purchased in 2010. DVD 5.9.5

    I'm having no problem with my DVD.

    Could you give more details about those who are out of work?

  • My DVD works on our television screens, but not on some of our friends in televisions

    My DVD works on our television screens, but not on some of our friends television screens.
    He plays a photo then restarts and then plays two photos then restarts then plays three photos then restart etc etc..
    What is a parameter when creating the video to digital photos or a parameter on television of our friends?

    It has nothing to do with the connected TV!
    It s is the DVD drive!

    Some players can't handle all CD or DVD! Which is one reason why the created image DVD does not work with the friend (s) disk drive.

    You will need to test various DVDs of different drive manufacturers. Some discs are more compatible as other drives

  • Satellite L300 - do not display some or even a part of web page

    A new laptop 2 days ago will not display some web pages (or sometimes a part of) even if a second machine to apparently the same specification (family Vista premium with IE8 on the same connection has no problem)

    A particular example is the http://www.java.com/en page where the machine in question opens the Java in action and the Help Center pages but not the downloads page. When you click on the link, the link from the State to the bootom of the screen seems to show this loading, but nothing appears

    Is there something obvious please?

    Hello

    This only happens on the web pages where you need Java?
    If so I can recommend to update the Java version. On my Satellite A300 with Vista, I got a problem that the browser crashes on websites with Java. I've updated the Java software and since their all works well.

    In addition, you should try it with a different Internet browser, Firefox for example. This browser is faster than IE8 and there is a lot of useful modules available.
    Check it!

  • My 1.6.1 Safari does not open some sites like my medical AARP account. How can I fix it?

    My 1.6.1 Safari does not open some sites, like my medical account of AARP. How can I fix?

    Safari 1.6.1?

    What version of Mac OS X are you running?

  • I get this error "Flight Simulator could not load some program files and will now close" - does anyone know how to solve?

    I get this error "Flight Simulator could not load some program files and will now close" - does anyone know how to solve?

    Hello

    I suggest you to please follow the steps described in the following articles and check if it helps.

    "Invalid product key" error in Microsoft Games, MapPoint, or Streets & Trips

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

    How to get a new product key for Microsoft Games for Windows, Streets & Trips, or MapPoint

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

    Let us know if it helps!

  • Windows Media player on my machine does not run some AVI files. How can I check what the problem with AVI files. Files are running in other utilities of free ware

    Windows Media player on my machine does not run some AVI files. How can I check what the problem with AVI files. Files are running in other utilities free ware. Also, windows Explorer does not display dimension and other video related information for the file. Y at - it a tool that can indicate what exactly is the problem with the file.

    Ritu

    Hello

    1. you get any error message?

    2. don't you make changes to the computer before the show?

    Please follow the steps from the link below.

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

  • Email sent using gmail pop, while on outlook express 6 is checked in to the gmail server sent the file, but not on my express outlook sent folder.

    Original title: problem with outlook express 6 and gmail

    Email sent using gmail pop, while on outlook express 6 is checked in to the gmail server sent the file, but not on my express outlook sent folder.  How can I have email sent appear in Outlook express 6 sent folder.  I put it as pop not imap

    Any suggestions?

    Check in OE under Tools | Accounts | Mail | Properties and ensure that it is not set to IMAP.  It seems to me that if you use IMAP folders.  If it isn't, in addition to the suggestion of Umesh, you can try to go to file | Identities and install a new identity and add your POP3 account and see if it works very well.

    Steve

Maybe you are looking for

  • In the Sierra how to purge the Macintosh HD

    I have a MacBook Pro (retina, 15 inches, early 2013) and am upgrading of El Cap of Sierra. Sierra storage tab "about this Mac" said that the Macintosh HD 70 GB which is purgeable. How to purge the Macintosh HD?

  • How can I speed up the movement of the dashes (-)?

    When you type in an application that requires a series of dashes, they move so slowly that I end up having to hit the key every time sometimes through the entire letter. My trackball moves the cursor perfectly fine, but when you use the keyboard layo

  • Problem installing office

    I try to install an office and a hotsink for my Zire 21.  I just changed to Windows 7 64 bit XP and tried to install the 4.1 and 6.2 following all the tips and tricks that I can find and get still 2 error messages.  First is, unable to connect to the

  • No Wifi Iconia W500 with windows 10

    Hello I upgraded my Acer Iconia W500 from Windows 7 to Windows 10 own factory.  I made sure that I have ALL the updates from Microsoft.  Everything works great EXCEPT that I can't get Wifi to turn on.  The button to activate the Wi - Fi is grayed out

  • Reference DELL INPIRON - sense of the power light flashes (4times orange short, 1 long white period)

    My Dell Inspiron 1545 started blinking the power light in the following model: 4 times orange (fast) 1 white (slow) I installed the software 'My Dell' and a health check. Nothing wrong was found. What does flashing power light mean? Thank you Leo.