Updating my script to add in the Name of the VM in VMM

Hello,
I run the following script from our VMM server and it's working well in that it gives me the location of the folder where the VM lives and whether or not the VM is fixed or dynamic (or a checkpoint).
But what's missing is I want to add in the Name of the VM that this location belongs too.  The $_.Name gives me the name of the .vhd file...but in some cases the name of the .vhd files is just Cdrive or Ddrive. 
$results = @()
$VMs = Get-SCVirtualMachine
Get-SCVirtualMachine | Get-SCVirtualHardDisk | foreach-object {
$results += New-Object PsObject -Property @{
Name = $_.Name
Location = $_.Location
VHDType = $_.VHDType
$Results | Export-Csv -NoTypeInformation "C:\Powershell_Scripts\results.csv"
Thank you.

Hi Greavette,
To add the vm name column in the output, please refer to this script, please note I haven't tested:
$results = @()
$VMs = (Get-SCVirtualMachine).name #get all vm names
foreach-object($vm in $vms){
Get-SCVirtualHardDisk -VM $vm | foreach-object {
$results += New-Object PsObject -Property @{
VM = $vm
Name = $_.Name
Location = $_.Location
VHDType = $_.VHDType}
$Results | Export-Csv -NoTypeInformation "C:\Powershell_Scripts\results.csv"
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang

Similar Messages

  • Just updated my iphone. Now I can se I have two? iCloud accounts? One of them appears on my phone, and I have forgotten the password. When I try to add the other account, I get the message that this account is already added, but with the name of the first

    Just updated my iphone. Now I can se I have two! iCloud accounts? One of them appears on my phone, and I have forgotten the password. When I try to add the other account, I get the message that this account is already added, but with the name of the first account where there is no available password. I have tried several times to reset the password, bun I don't get the information I need - I have no access to email. What can I do?

    Hi, thanks for the suggestion. I have tried as you suggested, and when opening the "purchased" apps some have the icloud logo next to them, but I only have "OPEN" against "Find My iPhone". When opening it up, it goes through the same routine; needs to be updated before proceeding, and wouldn't update because I don't have IOS8.
    Anything else I could try, or am I doomed!
    All of your help is much appreciated, thanks

  • I updated to Firefox 4 and now I don't seem to have the Mozilla weather program, which I had before. Can't remember the name of the weather program.

    I can't remember the name of the Mozilla weather program that was on my computer, but it's no longer there now that I've updated to Firefox 4.0.1. I don't know how to get it back!

    You ''may'' have created a customized Google home page. Try this address and when you find your customized page, you can make it your home page:
    http://www.google.com/ig
    [http://support.mozilla.com/en-US/kb/How%20to%20set%20the%20home%20page How to set the home page | How to | Firefox Help]
    ''On the other hand'', if your weather appeared in a toolbar, it's possible that the add-on is not yet compatible with Firefox 4. If you explore the following list, can you find a disabled weather add-on?
    (If you have the orange Firefox button, tap the Alt key)
    Tools > Add-ons > Extensions

  • New tabs are not updating the names of the sites they have loaded. When I open a new tab and load a site, the tab simply stays named "New Tab". When I open a link in a new window, it shows "Connecting..." even while its fully loaded.

    New tabs are not updating the names of the sites they have loaded. When I open a new tab and load a site, the tab simply stays named "New Tab". When I open a link in a new window, it shows "Connecting..." even while its fully loaded.

    This issue can be caused by an extension that isn't working properly.
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * [[Troubleshooting extensions and themes]]

  • I have 3 iTunes libraries on my one one computer and since I updated to the new version I can no longer see who's library I am in. It used to show at the top of iTunes the name of the library I was in.  Is there a way I can tell which library I am in?

    I have 3 iTunes libraries on my one one computer and since I updated to the new version I can no longer see who's library I am in. It used to show at the top of iTunes the name of the library I was in.  Is there a way I can tell which library I am in without closing and reopening?

    No. Frequently the apps take up more storage space on the iPod that the file download size.

  • I found the solution to a Mavericks bug on the Mail program. How can I share it? Several of my mail boxes stopped functioning properly when I updated to Mavericks. After long hours, I discovered that if I change the name of the mailbox, the content works.

    I found the solution to a Mavericks bug on the Mail program. How can I share it? Several of my mail boxes stopped functioning properly when I updated to Mavericks. The title of the mails stored in the mailbox appear, but the content was unavailable.
    After 4 long hours at the phone with the Apple staff unable to help me, I discovered that if I change the name of the mailbox, the contents of the mails stored there become available.
    Please, make this solution available to other people!

    You have found the the way to share it.   Include your problem and its solution in a forum post in the Mavericks forums.   Then mark you own post with a green solved star.
    Note.  You won't get any points for that; points are only awarded where you mark someone else's post as either helpful or solved.

  • When i delete an audio book from my computer it does not delete the book from my Iphone. it seems to be deleting the name from the computer but not the content. this has just started happening since the last itune progam updated. the result is i have

    I record audio books from my library onto my old iPhone. I download the book from Overdrive to my computer. I connect the Iphone to the computer and transfer the audio-book to the iPhone.  When I am done listening to the book i delete it from the iPhone by connecting it to the computer and doing a manual sync. this worked fine until the last i-tunes update on my computer. Now when the iPhone is connected and i tell the computer to delete a book it is only deleting the name of the book on the computer it is not deleting the book from the phone. The next time I connect the phone to the computer the program does not show the book in the phone but it is still in the phone.  I have no more room on my phone to get any new books on it.
    Does anyone know how to fix this? Please

    You are correct.  Syncing should transfer any purchased media, including videos, from your device to your iTunes library provided your computer is authorized for the Apple ID used to make these purchases.  You mentioned that you have uninstalled iTunes before, but if you didn't follow this guide exactly, uninstalling iTunes and all of its components in the order specified, it may not have been successful so you should try again:  Windows XP or Windows Vista/7.

  • I can't add the contacts from Microsoft to the OS X 10.10 It makes me can not know the name of the people I talking to on message, mail.

    I can't add the contacts from Microsoft to the OS X 10.10
    It makes me can not know the name of the people I talking to on message, mail.

    i need help

  • I have Lion software installed on my IMac (purchased IMac 2008). I need to know the names of the updates since Lion, and how to get them. Thanks,  Don

    I Need to know the names of the updates after Lion and how to get them.  Tanks,  Don

    Back up your data and download Mavericks from the Mac App Store. You don’t need to buy Mountain Lion to do this.
    (110438)

  • I need to create an action or script to save the file with the name of the selected layer

    I need to create an action or script to save the file with the name of the selected layer (not including the hidden layers, but including those visible).
    How could modify the script: 'Layer Comps To Files.jsx' to get the result?
    Warning: I do not need to export all layers as files.
    Who can help me?
    THX in advance

    Versione in Italiano (Further down the English version)
    NB - Nella versione inglese ho messo tutte le immagini dei menu in italiano.
    Versione per Mac, ma credo sia identico per Windows.
    Spiego passo passo cosa ho fatto:
    - Ho creato un file esempio con tre Livelli, salvato sulla scrivania e ho chiuso il file.
    - Ho aperto il file e selezionato il Livello al centro per iniziare a registrare una azione che ho chiamato: Save with Name of Selected Layer
    - Nuova azione
    - Dare il nome e premere Registra
    Ora salva…
    - Menu --> Livello --> Nuovo --> Livello... e premi -ok-, (lascia il nome che viene mostrato)
    - Ancora una volta Menu --> Livello... --> Nuovo --> Livello... e premi -ok-, (lascia il nome che viene mostrato)
    - Menu --> Livello --> Ordina --> Dietro
    - Menu --> Livello --> Unisci sotto
    - Menu --> Livello --> Unisci visibili
    - Menu --> Livello --> Nuovo --> Livello... e premi -ok-, (lascia il nome che viene mostrato)
    - Menu --> Livello - Nascondi Livello
    - Menu --> Elimina --> Elimina livelli nascosti (press -Yes-)
    - Menu --> Livello --> Nuovo --> Livello... Inserisci questo: 'Move this to the trash' e premi ok
    - Menu --> File --> Script --> Esporta Livelli in File... (Nella finestra che si apre scegliere l’opzione che si desidera, ma togliere il prefisso del nome) e premere -Esegui-
    - Selezionare il pannello Storia cliccare su Elimina premendo -Si- ogni volta che si apre la finestra di dialogo (Ripetere 8 volte questa operazione sino ad arrivare nella storia alla condizione di partenza. Ho visto che è meglio di Ripristina -F12-)
    - Fermare la registrazione.
    A questo punto, mandando in esecuzione questa Azione, ho raggiunto parzialmente l’obiettivo perché i file così creati mantengono, purtroppo, dei prefissi numerici per evitare probabilmente la sovrascrizione di file (credo senza avviso) nel posto dove vengono creati.
    Per ottenere l’obiettivo occorre un nuovo passo ed a proposito di questo riferisco quanto segue:
    ATTENZIONE - L’operazione descritta qui di seguito deve essere fatta su di una copia del file, per cui:
    - Duplicare il file,
    - Spostare l’originale in altra cartella
    - Lavorare sul file duplicato.
    mi riferisco a questo...
    ATTENZIONE - Questa modifica è effettuata a proprio rischio e pericolo ed il sottoscritto non si assume alcuna responsabilità su quanto venga fatto soprattutto da mani inesperte.
    ATTENZIONE - Questa modifica sovrascrive qualsiasi file che abbia nome uguale al layer che viene selezionato più l’estensione del file naturalmente.
    Comunque la modifica è banalissima e a portata di chiunque.
    Procedere così:
    - Chiudere Photoshop
    - Aprire (nel percorso specificato dall’immagine) il file “Export Layers to Files.jsx” (Export Layers To Files.jsx 1.0.0.16) con un editor di testo puro.
    - cercare la stringa (dovrebbe essere in riga 1029)
    var fileNameBody = fileNamePrefix;
    fileNameBody += "_" + zeroSuppress(i, 4);
    fileNameBody += "_" + layerName;
    - sostituirla con:
    var fileNameBody = fileNamePrefix;
    fileNameBody += layerName;
    - cercare la stringa (dovrebbe essere in riga 1047-46)
    var fileNameBody = fileNamePrefix;
    fileNameBody += "_" + zeroSuppress(i, 4) + "s";
    - sostituirla con:
    var fileNameBody = fileNamePrefix;
    fileNameBody += "";
    - salvare e uscire.
    - riavviare Photoshop
    - provare l’azione registrata facendo attenzione che il nome del layer non sia identico al nome di un file già presente altrimenti questo verrà sovrascritto.
    Domanda:
    Perché ho creato livelli che poi ho eliminato ecc.
    Risposta:
    Semplice per evitare errori di esecuzione delle azioni nel caso di operazioni con livelli mancanti o altro.
    Semplice... no?
    English version
    Mac version, but I think it's the same for Windows.
    First of all, I'm translating the actions that I made using the Italian version of Photoshop, you look at the position of the menu that I have chosen to do the work with other languages.
    I explain step by step what I did:
    - I created a sample file with three layers, saved to the desktop and I closed the file.
    - I opened the file and select the layer at the center to start recording an action that I called: Save with Name of the Selected Layer
    - New action
    - Give the name and press Save ( I think it is so in English )
    Now save ...
    - Menu -> Layer - > New —> Layer… and press -ok- , (leave the name that is shown)
    - Once again Menu -> Layer - > New —> Layer… and press -ok- , (leave the name that is shown)
    - Menu -> Layer - > Arrange (order) -> Behind
    - Menu -> Layer - > Merge Down
    - Menu -> Layer - > Merge Visible
    - Menu -> Layer - > New —> Layer… and press -ok- , (leave the name that is shown)
    - Menu -> Layer - Hide Layer
    - Menu - > Delete - > Delete hidden layers (press -Yes- )
    - Menu -> Layer - > New —> Layer… Enter this: ' Move this to the trash ' and press ok
    - Menu -> File - > Scripts -> Export Layers To Files... (In the window that opens select the option you want, but take away the name prefix) and press - Run -
    - Select the History panel and click Delete (on menu opened) pressing -Yes- every time when open the dialog box (8 times Repeat this step until you get into the story to the starting condition. Not use Restore -F12-).
    - Stop recording.
    At this point, by executing this action, I have reached the goal partly because the files created in this way remain, unfortunately, the numerical prefixes to avoid possibly overwriting of files (I think without notice) in the place where they are created.
    To achieve the goal we need a new step and thinking about this as follows:
    WARNING - The operation described below should be made on a copy of the file, so :
    - Duplicate the file
    - Move the original folder to another
    - Work on the duplicate file.
    WARNING - This modification is performed at your own risk and the undersigned assumes no responsibility on what is done mostly by inexperienced hands.
    WARNING - This change will overwrite any files with the same name as the selected layer plus the file extension of course.
    However, the change is trivial and within reach of anyone.
    Proceed as follows:
    - Close Photoshop
    - Open (in the specified path from the image ) file " Export Layers to Files.jsx " (Export Layers To Files.jsx 1.0.0.16) with a pure text editor.
    - Search for the string (should be in line 1029 )
    var = fileNameBody fileNamePrefix ;
    fileNameBody = + "_" + zeroSuppress (i, 4 ) ;
    fileNameBody + = "_ " + layerName ;
    - Replace it with :
    var = fileNameBody fileNamePrefix ;
    fileNameBody + = layerName ;
    - Search for the string (should be in line 1047-46 )
    var = fileNameBody fileNamePrefix ;
    fileNameBody + = "_ " + zeroSuppress (i, 4) + "s" ;
    - Replace it with :
    var = fileNameBody fileNamePrefix ;
    fileNameBody + = "";
    - Save and exit.
    - Restart Photoshop
    - Try the recorded Action, making sure that the layer name is not identical to the name of an existing file otherwise it will be overwritten.
    Question:
    Why I created levels which I then deleted etc..
    Answer:
    Simple to avoid errors of execution of the actions in the case of transactions with missing levels and other.
    Simple ... is not it?
    Sorry for my bad English...
    Thanks in advance for any hint.
    --->>> Please think about this... Adobe <<<---

  • What is the name of the Firefox add-on where on your home page you can set multiple quick links to your favourite web sites?

    What is the name of the Firefox add-on where you can set multiple links to your favorite web sites on your home page?i used to have it on my old laptop but cant remember what it is called

    You can do that with an extension like the Google Toolbar.
    http://www.google.com/support/toolbar/bin/answer.py?answer=115561 - Web-browsing tools : Google new tab page and most visited websites - Toolbar Help
    Others:
    *Speed Dial: https://addons.mozilla.org/firefox/addon/4810
    *Fast Dial: https://addons.mozilla.org/firefox/addon/5721

  • Hello I have problome with YouTube on my apple tv. When I add playlist on my Mac I can see the movies and play them but I can't see the movies on my appletv only the name of the playlist and I am can't watch the movies. Anyone know the problome? Please..

    Hello I have problome with YouTube on my apple tv. When I add playlist on my Mac I can see the movies and play them but I can't see the movies on my appletv only the name of the playlist and I am can't watch the movies. Anyone know the problome? Please..

    Geesh - all this information and no  one has any clue to this? Not even someone from Apple?
    Can someone at least point me in the right direction?

  • Ive just updated itunes and now i cant view any items in the itunes store, all that appears are the names of the songs or films under blue boxes, any ideas would be greatly appreciated thanks

    ive just updated itunes and now i cant view any items in the itunes store, all that appears are the names of the songs or films under blue boxes, any ideas would be greatly appreciated thanks

    are you signed in? do you have an account setup with itunes store?
    did you authorize the computer?

  • When I add a new bookmark sub-folder, it also changes the name of a different folder to the name of the new sub-folder

    When I add a new bookmarks sub-folder, it also changes the name of another folder to the name of the new sub-folder. For example, I have folders A, B, C - I add a sub-folder to A and call it X - it does that and also changes the name of C to X.

    I suggest you install the "Add Bookmark to Here2" extension, then you can expand the the list but you will not see the bookmark itself in the list if that is what you wanted. At the top you have three major folders you can select one of them and scroll up and down. Below that you have your most recently used folders and you can select one of them instead and scroll up and down. You can see the folder the bookmark is in -- they get added to the bottom
    If you really want to see the bookmark within the folder the same extension allows you to bring the bookmark to the folder from say the bookmarks sidebar that is why it is named as such. I use it but mainly i use the dialog.
    Please continue reading about bookmarks and some related extensions at
    * http://kb.mozillazine.org/Sorting_and_rearranging_bookmarks_-_Firefox
    * https://addons.mozilla.org/firefox/addon/add-bookmark-here-2/
    * http://dmcritchie.mvps.org/firefox/firefox.htm#addbookmarkhere2
    * http://dmcritchie.mvps.org/firefox/kws.htm
    If you are not using tags at all, you can remove a whole lot of confusion by removing them from the dialog via the extension.

  • Trying to change the name to the itunes account and made one myself because my sister use to use my computer and updating my apps where under her email now that i made my own i cant update anything on my phone its still showing my sisters email.

    basically my sister used my computer and everytime we had to update our apps it would be her email thats showing and thats when i knew that pw. since shes doesnt use it anymore i made my own and now it wont let me update it its still showing hers.

    To change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iDevice, then sign back in with the ID you wish to use. 
    If your sister doesn't know the password for her old ID, and if her old ID is an earlier version of her current ID, she needs to temporarily recreate the old ID so you can delete if from your phone using her current password.  To do this, have her go to https://appleid.apple.com, click Manage my Apple ID and sign in with her current iCloud ID.  Click edit next to the primary email account, change it back to her old email address and save the change.  Then edit the name of the account to change it back to her old email address.  You can now use the password for her current ID to turn off Find My iDevice on your device, even though it prompts you for the password for her old account ID.  After you do this, Next, have your sister recreate her current ID again by going back to https://appleid.apple.com and changing her primary email address and iCloud ID name back to the way it was.
    Then your can save any photo stream photos that you wish to keep to the camera roll on your device, then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted.  You will be prompted to either keep or delete the iCloud data from your device.  If the data is already in another account you can choose Delete.  If you need to migrate it to another account, choose Keep, then choose Merge when signing into the new account.

Maybe you are looking for

  • Mail Server suddenly stopped working

    My mail server has stopped working, and I can't figure out why. This is a brand new MacMini with the latest Maverics Server (preinstalled) that I just setup last month. (We migrated from an Xserve running 10.6.) Up to this point, mail has worked flaw

  • HT1937 no power  i am trying to charge and open my i phone5 but it is not working or charge

    i am trying to charge and open my i phone5 but it is not working at all

  • Connecting with the printer

    I can't send documents to my printer to print because my laptop says that the printer is 'offline'. However when I check the connection on the printer itself it says that it's connected to wifi. But my laptop still can't send documents to the printer

  • Can't enable mailbox audit logs

    Hello! I can't enable mailbox audit logs. I use cmdlet Set-Mailbox -Identity "mailbox" -AuditEnabled $true and Get-Mailbox shows that audit is enabled. But when i check Get-Mailbox| Get-MailboxFoldersStatistics there is no "Audit" subfolder, and all

  • Authorization window behind the running application

    Hello. My problem is that when launching my application with javawebstart, it happens that the authorization window appears first, then my application appears then, and hide the authorization window. The consequence of this is that the application is