PowerCLI

 View Only
Expand all | Collapse all

List VMs in datastore that is not in inventory

klee222

klee222Feb 12, 2018 07:28 AM

klee222

klee222Feb 12, 2018 09:55 AM

  • 1.  List VMs in datastore that is not in inventory

    Posted Oct 26, 2015 02:33 PM

    Hi Guys

    PowerCLI rookie here, so sorry for stupid questions.

    I’m trying to clean up a bunch of singehost with local datastores. So I need a script that can output a list of virtual machine files on a datastore that is not being used by VMs in the inventory. One of the problem is that the files on the datastore, is not all ways named exactly the same as the VM’s in the inventory.

    Been looking at this, but I think the term “orphaned” is ‘sent what I think it is:

    https://communities.vmware.com/thread/266913

    Also there is this one, which I think I should be able to modify to do what I want:

    http://www.wooditwork.com/2011/08/11/adding-vmx-files-to-vcenter-inventory-with-powercli-gets-even-easier/

    Any hints or clues to push me in the right direction would be appreciated.



  • 2.  RE: List VMs in datastore that is not in inventory

    Posted Oct 26, 2015 02:49 PM

    In the script in Orphaned files and folders – Spring cleaning you can specify specific datastores to check.



  • 3.  RE: List VMs in datastore that is not in inventory

    Posted Oct 28, 2015 08:27 PM

    Wow Luc - you do answer the threads in here as fast as Alan said you would, in Barcelona :smileyhappy:

    Your script works great on shared datastores, however I can't get it to pick up orphaned files on singlehosts with local datastores.

    I removed the you line 42 : if($ds.Type -eq "VMFS" -and $ds.ExtensionData.Summary.MultipleHostAccess), but still nothing.



  • 4.  RE: List VMs in datastore that is not in inventory

    Posted Oct 28, 2015 09:54 PM

    By "singlehosts" do you mean standalone host not connected to any vCenter?





  • 5.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 06:12 AM

    You have to remove the condition that checks for shared datastores, so change that line to

    if($ds.Type -eq "VMFS")



  • 6.  RE: List VMs in datastore that is not in inventory

    Posted Aug 05, 2016 01:20 PM

    First off, many thanks!

    I tested your Register-VMX function on one of our Engineering clusters. It did the job, but it probably needs an update.

    It would search the datastores and register the vmx, however you can't specify where to register it at. So instead of ending up back on my engineering cluster it went to one of my production clusters. Additionally registering a vmx file by cluster or datacenter just closed my ISE session.

    I'll take a look at it and see what I come up with. In the meantime if you have any updates please share them.

    Thanks again.



  • 7.  RE: List VMs in datastore that is not in inventory

    Posted Aug 05, 2016 01:48 PM

    Thanks.

    That is indeed a good idea, an option to specify where it should register the VM.

    Now it registers the VM in the parent Datacenter, and the VM will appear on the host or in the cluster where they were before, if I'm not mistaken.

    What would you prefer when that destination is not fit to register the VM, for example datastore not mapped to a cluster?



  • 8.  RE: List VMs in datastore that is not in inventory

    Posted Aug 05, 2016 05:18 PM

    I can test some more, but initially my VM's that I unregistered in my engineering cluster were coming back on a separate production cluster in the same datacenter.

    As for the error message, whatever you deem acceptable. I'm just happy you put this out there. It still gets the job done either way. We've done work previously where our VM's get unregistered and we didn't know which datastore it was on.

    That's a headache, so again, many thanks.



  • 9.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 07:31 AM

    Thanks Luc, but I already tried that, still doesn't pick up the orphaned vmdk file.

    By singlehosts, I mean hosts that is not joined to a cluster, but are added to a VCenter.

    Heres the environment, and a test VM on the datastore that is not in inventory.



  • 10.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 07:40 AM

    Can you check what the DisplayName in the VMX file says ?

    It could be that these files are attached to a VM that is registered under another DisplayName than mhetest.



  • 11.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 07:45 AM

    That does not seem to be the issue.

    displayName = "mhetest"



  • 12.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 07:52 AM

    Ok, just trying to find out why the files are not listed as orphaned.

    The script uses the following logic:

    1. it gets the VMs on that datastore from vCenter
    2. it gets all the files on the datastore
    3. it compares the files from 1) with the files from 2). The difference are the orphaned files

    Does

    Get-VM -Datastore 'MyDS'

    return the VM ?



  • 13.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 09:13 AM

    I have  created some scripts based on the logic provided by LucD with some modification to fit my needs.

    The difference is that there is one script per step in the logic.

    One script extract the files attached to all VMs

    One script extract all files located in a specific datastore(s).

    ...

    So it you use the two scripts above you can then compare the results of the step 1 and step 2 manually instead of letting the script doing it in the step 3.

    http://thecrazyconsultant.com/find-orphaned-vmdk-files-workflow/



  • 14.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 01:39 PM

    Yup that what been trying to figure out.

    If the VM is in the inventory the command Get-VM -Datastore 'MyDS' lists the mhetest vm on the datastore, if i remove it from the inventory and leave it on the datastore it does not show up when running Get-VM -Datastore 'MyDS'


    Note, the ESXi host is named the exactly same as the datastore, could that be part of the problem?




  • 15.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 01:42 PM

    No, the same name for the datastore and the ESX host shouldn't be a problem.

    Does the VM still show when you do a

    Get-VM -Name mhetest

    after removing it from the inventory



  • 16.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 02:23 PM

    If the mhetest VM is not in the inventory and I do a it do a Get-VM -Name mhetest it does not show up.



  • 17.  RE: List VMs in datastore that is not in inventory
    Best Answer

    Posted Oct 29, 2015 03:54 PM

    Please try:

    $AllFilesLocalDatastore = Get-datastore "localdatastorename" | get-fileindatastore

    $FilesIdentifiedAsAssociatedToAllVMs = Get-FilesIdentifiedAsAssociatedToAllVMs

    #The two functions above are available there http://thecrazyconsultant.com/find-orphaned-vmdk-files-workflow/

    Check the content of the two variables for example with ogv or export-csv

    $AllFilesInESX01LocalDatastore | ogv

    Then try:

    $FilesNotIdentifiedAsAssociatedToAnyVM = $AllFilesLocalDatastore  | foreach-object{

              $FullPath = $_.FullPath

                If ($FilesIdentifiedAsAssociatedToAllVMs.FileName -notcontains $FullPath){

                Return $_

                }

    }

    $FilesNotIdentifiedAsAssociatedToAnyVM | ogv

    #The above one will contain all files not identified as associated to any VM

    $ProbablyOrphanedFiles = $FilesNotIdentifiedAsAssociatedToAnyVM | where{ $_.FileTypeFullName -match "VMware.Vim.Vm*" -OR ($_.FileTypeFullName -eq "VMware.Vim.FileInfo" -AND ($_.Fullpath -match ".vmsd" -OR $_.Fullpath -match ".vmxf" -OR $_.Fullpath -match "aux.xml" -OR $_.Fullpath -match ".vswp" -OR ($_.Fullpath -match ".vmdk" -AND $_.Fullpath -notmatch "ctk.vmdk") -OR ($_.Fullpath -match ".vmx" -AND $_.Fullpath -notmatch ".vmx~" -AND $_.Fullpath -notmatch ".vmx.lck") ))}

    $ProbablyOrphanedFiles | ogv

    Edit:

    Edited the datastore name, it seems that it was not supposed to be in the initial screenshot.

    Edit2:
    Switch order of the first command, more details in the last post in this thread



  • 18.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 08:41 PM

    Christophe - That's awesome, I owe you a beer man:smileyhappy:

    I believe that's gives me the result I was looking for.

    Again - Thanks Luc and Christophe!



  • 19.  RE: List VMs in datastore that is not in inventory

    Posted Feb 06, 2018 05:47 PM

    Hi

    i'm new here and i dont get it how to run those script.

    i copy entired script from Orphaned files and folders - Spring cleaning - LucD notes

    and pass to power cli. nothing came out?



  • 20.  RE: List VMs in datastore that is not in inventory

    Posted Feb 06, 2018 06:00 PM

    That script is a function, it will not do anything unless you call the function.

    See the Sample Runs sections on how to call the function.

    Place everything, function & function call, in a .ps1 file.

    Then "run" the .ps1 file from your PowerShell prompt.



  • 21.  RE: List VMs in datastore that is not in inventory

    Posted Feb 06, 2018 06:08 PM

    Hi LucD

    sorry to ask but how to "Place everything, function & function call, in a .ps1 file." ?

    I'm trying to get list and export to csv for those vm that are not presented / added to inventory but in datastore, so i found this article

    how should i edit and run it correctly ?

    thanks you



  • 22.  RE: List VMs in datastore that is not in inventory

    Posted Feb 06, 2018 06:19 PM

    Pick an editor (can be anything: notepad, notepad ++, PS ISE editor, VS Code....).
    Open a new file.Copy the function in that file.
    Then copy the call of the function into that file below the function.

    Save the file, pack any name but use the filetype ps1.

    From the PS prompt, call the .ps1 file by typing the path to it. For example C:\Scripts\MyScript.ps1

    If this is your first use of PowerShell, you will probably have to set the PowerShell ExecutionPolicy first.

    Do a 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned' from the PS prompt (make sure to start PowerShell as an Admin).

    There are a number of decent PowerShell introduction articles out there.
    You should start by reading one of those.
    See for example Running PowerShell Scripts Is as Easy as 1-2-3



  • 23.  RE: List VMs in datastore that is not in inventory

    Posted Feb 06, 2018 06:32 PM

    Hi LucD.

    Haha...i think i getting lose

    1.     i copy the script from 1st line

    function Remove-OrphanedData {

    <#

    .SYNOPSIS   Remove orphaned folders and VMDK files

    until last

    127 | }

    2. save this file in ps, example "orphaned.ps1" in some where like c:\script

    3. run power CLI and connect to Vcenter

    4. in power CLI, open this file from where it was save

    5. type "Remove-OrphanedData" , enter

    and result came out

    correct ?



  • 24.  RE: List VMs in datastore that is not in inventory

    Posted Feb 06, 2018 06:51 PM

    You forgot one part, you have to call the function.
    At the bottom of the file add one like you find the Sample Runs section of the blogpost.



  • 25.  RE: List VMs in datastore that is not in inventory

    Posted Feb 06, 2018 06:58 PM

    Hi  LucD,

    i'll try it out and let you know if any problem.

    although i seldom came here or only came here with some problem. i always saw your post any where LucD,

    excellent

    mean while i have a question on new post with subject "Setup my 1st complete Vcenter with 8 host, need advice. ( 8 host, 2 VC)"

    hope you can guide me there

    many many thanks



  • 26.  RE: List VMs in datastore that is not in inventory

    Posted Feb 06, 2018 07:08 PM

    That 2nd question is a quite general one, and is more related to designing a vSphere setup.

    I'm not sure if you'll find an answer on that in these communities.


    I agree with one of the responses in that thread, helping you with a design is more for a professional services person or a consultant or an experienced person on site.

    They will have to get to know your requirements, learn about limitations, available HW, infra, and so on.

    That is definitely not something you would get an answer on in a few lines in a community thread I'm afraid.



  • 27.  RE: List VMs in datastore that is not in inventory

    Posted Feb 07, 2018 02:50 AM

    Hi LucD

    i have save the file in PS and when i call it nothing happen?

    what went wrong?

    when i copy the file manually, here is the error

    and another try

    help help



  • 28.  RE: List VMs in datastore that is not in inventory

    Posted Feb 07, 2018 05:40 AM

    That is not what I said, you have to add that line to the .ps1 file at the end, not enter it at the prompt



  • 29.  RE: List VMs in datastore that is not in inventory

    Posted Feb 07, 2018 06:32 AM

    Hi LucD

    apologize, now i get it.

    but can i check with you these error ?

    1)  Name not correct ?

    2) i try manually copy script and pass into CLI , and then run the function call manually by enter datastore one by one. all seem pass?

    also i notice some command just take mili second (superfast,feel like not working)

    3) Data store not work in here? because not cluster?

    sorry to take time understand the script



  • 30.  RE: List VMs in datastore that is not in inventory

    Posted Feb 07, 2018 06:36 AM

    If you have special characters in the datastorename, enclose the name in single quotes.



  • 31.  RE: List VMs in datastore that is not in inventory

    Posted Feb 07, 2018 06:54 AM

    Hi LucD

    thanks for the guide, is there any way to run as the datastore are in use and there is VM inside.

    Not sure what happen if renamed it. ><'

    for question 2 and 3 would you help verify, sorry for asking so much .

    thanks you



  • 32.  RE: List VMs in datastore that is not in inventory

    Posted Feb 07, 2018 07:01 AM

    2. If there are no, or hardly any VMs on that datastore, the function might return quite quickly

    But are these perhaps NFS datastores?
    The default function only looks at VMFS datastores

    3. Shouldn't make a difference

    Not sure what you mean with "...to run as the datastore are in use and..."

    The idea is that this function runs against datastores that are used to store VMs



  • 33.  RE: List VMs in datastore that is not in inventory

    Posted Feb 07, 2018 07:38 AM

    Hi LucD

    missing grammar

    is there anyway to run same as the name given to datastore, it was in use and there is vm insdie

    Not sure what happen if renamed it. ><'



  • 34.  RE: List VMs in datastore that is not in inventory

    Posted Feb 07, 2018 07:41 AM

    Still not sure what you mean I'm afraid.

    If you renamed the datastore, then you use the new datastorename.

    If you renamed a VM, and unregister it, it should be found by the script



  • 35.  RE: List VMs in datastore that is not in inventory

    Posted Feb 12, 2018 06:32 AM

    Hi

    I Went to the link

    http://thecrazyconsultant.com/find-orphaned-vmdk-files-workflow/

    and copy the last script  - get-ProbablyOrphanedFile and past it to CLI.

    then copy the script as following , any idea why the result was not show?



  • 36.  RE: List VMs in datastore that is not in inventory

    Posted Feb 12, 2018 07:01 AM

    Are you sure you where connected?

    After the Connect-VIServer did you check by displaying the contents of $global:defaultviservers?



  • 37.  RE: List VMs in datastore that is not in inventory

    Posted Feb 12, 2018 07:28 AM

    Hi LucD

    not sure if this are correct ?



  • 38.  RE: List VMs in datastore that is not in inventory

    Posted Feb 12, 2018 08:25 AM

    The Connect-VIServer seems to be correct.

    Not sure why you have the '?' after $global:defaultviservers



  • 39.  RE: List VMs in datastore that is not in inventory

    Posted Feb 12, 2018 09:19 AM

    Hi LucD

    i thought you ask to verify by " displaying the contents of $global:defaultviservers? "



  • 40.  RE: List VMs in datastore that is not in inventory

    Posted Feb 12, 2018 09:26 AM

    That was the question mark for my question, no you shouldn't type the question mark, just $global:defaultviservers



  • 41.  RE: List VMs in datastore that is not in inventory

    Posted Feb 12, 2018 09:55 AM



  • 42.  RE: List VMs in datastore that is not in inventory

    Posted Feb 12, 2018 12:14 PM

    Ok, going back to the error, you seem to be doing a Disconnect-VIServer from a server TestVC, which is not the name of your vCenter.

    It looks as if the code you copied contains that TestVC somewhere in there.

    Replace that with your own vCenter name.



  • 43.  RE: List VMs in datastore that is not in inventory

    Posted Feb 13, 2018 02:45 AM

    Hi LucD

    this is the screen shot , nothing came out ?



  • 44.  RE: List VMs in datastore that is not in inventory

    Posted Feb 13, 2018 05:57 AM

    Then you probably have no orphaned VMs



  • 45.  RE: List VMs in datastore that is not in inventory

    Posted Feb 13, 2018 06:06 AM

    Hi lucD

    i seem, but when i use your script it show some of this file ( i filtered by vmx)

    any different ?? just curios

    without filters is as per attachment  (sheet 1 is using your script, sheet 2 is using RV tools scan).



  • 46.  RE: List VMs in datastore that is not in inventory

    Posted Feb 13, 2018 06:07 AM

    Can you attach (as files) both scripts you are using?



  • 47.  RE: List VMs in datastore that is not in inventory

    Posted Feb 13, 2018 06:17 AM

    Hi LucD,

    I updated with attached the result in excel sheet

    (Apologize, i attached the correct document here again, left size column is with RV tools, right side is with your script)



  • 48.  RE: List VMs in datastore that is not in inventory

    Posted Feb 13, 2018 07:15 AM

    What I meant was the code of both scripts, the one that doesn't return anything, and then the version of my code you are using.

    That way I can compare which of the two might go wrong.



  • 49.  RE: List VMs in datastore that is not in inventory

    Posted Feb 13, 2018 07:44 AM

    Hi LucD

    here is the attachment.

    from your script i copied and past into CLI, and then follow by command "Remove-OrphanedData -Datastore DS1" where DS1 i replace with my existing datastore one by one.

    from another script i copied and past the "get-ProbablyOrphanedFile" , and then run  this  command "Get-Datastore | where {$_.name -like “SSD*”} | get-ProbablyOrphanedFile -matchpattern “*.vmx”| ogv" and follow by next script "DIsconnect-VIServer -Server “testVC” -confirm:$False" as per screen shot.



  • 50.  RE: List VMs in datastore that is not in inventory

    Posted Feb 13, 2018 08:17 AM

    With the 2nd script you are using a Where-clause to only look at datastores whose name starts with SSD.

    Do you actually have such datastores?
    Try leaving out the Where-clause, and only select DS1, like

    Get-Datastore -Name DS1 | Get-ProbablyOrphanedFile -matchpattern “*.vmx”|

    Out-GridView



  • 51.  RE: List VMs in datastore that is not in inventory

    Posted Feb 13, 2018 08:36 AM

    Hi LucD

    here is my datastore summary

    and this is what i run just now



  • 52.  RE: List VMs in datastore that is not in inventory

    Posted Feb 13, 2018 10:52 AM

    You have to dot-source that Get-ProbablyOrphanedFile function before calling it.

    Otherwise you get exactly that error.

    Store the code of the function in a .ps1 file, then dot-source the .ps1 file from the prompt (. .\thefile.ps1, and yes, there is a blank between the two dots)

    After that you should be able to call the function from the prompt.

    From your datastore list, it looks like you have no datastores whose name starts with SSD.

    So that explains why nothing comes out of the call you made earlier.



  • 53.  RE: List VMs in datastore that is not in inventory

    Posted Feb 14, 2018 03:55 AM

    Sorry LucD

    not sure which area went wrong ( I have test blank between two dot)



  • 54.  RE: List VMs in datastore that is not in inventory

    Posted Feb 14, 2018 05:31 AM

    The function Get-FileInDatastireWithWorkflow is missing.



  • 55.  RE: List VMs in datastore that is not in inventory

    Posted Feb 14, 2018 05:38 AM

    Hi LucD

    how to fix this? where edit ?

    help help



  • 56.  RE: List VMs in datastore that is not in inventory

    Posted Feb 14, 2018 05:47 AM

    You'll find that missing function at the same location where you found the other function.

    See Find orphaned vmdk files via workflow



  • 57.  RE: List VMs in datastore that is not in inventory

    Posted Feb 14, 2018 07:02 AM

    Hi LucD

    i'm not good to modify the function, can help ? apologize

    also can i modify SSD to non-SSD

    Get-Datastore | where {$_.name -like “SSD*”} | get-ProbablyOrphanedFile -matchpattern “*.vmx”| ogv

    Get-Datastore | where {$_.name -like “NON-SSD*”} | get-ProbablyOrphanedFile -matchpattern “*.vmx”| ogv



  • 58.  RE: List VMs in datastore that is not in inventory

    Posted Feb 14, 2018 08:09 AM

    You will have to include all functions from that webpage in the .ps1 file that you dot-source.

    The Where-clause you are using only looks at the name of the datastore, not the type of HW (SSD or non-SSD).



  • 59.  RE: List VMs in datastore that is not in inventory

    Posted Feb 14, 2018 08:31 AM

    Hi LucD

    so i have to run these all script into CLI ?

    Get-FilesIdentifiedAsAssociatedToAllVMs, Get-FileInDatastore,get-FileInDatastoreWithWorkflow & get-ProbablyOrphanedFile

    Means copy each of the script and paste into CLI ? then only can work?

    Also for SSD or non-ssd, i just have to enter the datastore name rather then SSD/Non-SSD.?



  • 60.  RE: List VMs in datastore that is not in inventory

    Posted Feb 14, 2018 08:37 AM

    You can paste the code on the prompt, but a better way would be to place all the functions n a .ps1 file.

    And then dot-source this file. That way the functions are known to your PowerShell session.

    Now you can make the call of the function.

    Yes, the Where-clause you are using uses the datastorename.



  • 61.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 08:47 PM

    Edit2:
    It is much better to run the first commands in this order:

    $AllFilesLocalDatastore = Get-datastore "localdatastorename" | get-fileindatastore

    $FilesIdentifiedAsAssociatedToAllVMs = Get-FilesIdentifiedAsAssociatedToAllVMs

    If the same script is launched accross many large datastore for example in a datastore cluster it will be common to see a storage vmotion or any others activies happening between the completion of the two commands.

    In that case it is better to have the latest pictures of the files associated to the VMs at the end.

    Worst case scenario, in case of a storage vMotion for example, it will end up with:
    Probably orphaned files will be the path of the "virtual machine in production" files "before" the storage VMotion...so it will not point to anything.

    In the other order, the probably orphaned files will be the path of "virtual machine in production" files "after" the storage VMotion....so in fact files that are not orphaned at all.



  • 62.  RE: List VMs in datastore that is not in inventory

    Posted Oct 29, 2015 09:16 PM

    I'm just reading it all making sure I understand everything. (still a rookie :smileyhappy:) So what do I gain by switching in the two lines?

    Regarding large datastores and vMotion.

    I get what you are saying, but as I said this part of the environment are single hosts with local storage so I'm not worried that's going to be an issue.



  • 63.  RE: List VMs in datastore that is not in inventory

    Posted Mar 02, 2018 11:05 PM

    Luc Dekens has the right answer as always.

    You need first the others functions. (I like the copy paste approach, even if it is not the best)

    Keep in mind that the function get-ProbablyOrphanedFile  is actually quite complex with a mix of API call, PowerShell workflow, call of others function and there are no errors handling.

    Moreover, it was developed a long time ago, and I have not tested it with new version. It should still work if the API have not been modified but this is not guaranteed.

    It is suitable for experienced PowerCLI user that will have the skills to adapt and troubleshoot it as needed.

    For your scenario, I will recommend a step by step troubleshooting.

    Step 1: Get the correct list of datastores

    Get-datastore | where {$_.something -eq “something”}

    I do not think that there is a “Drive Type” property for a PowerCLI datastore object, so it is not possible to use something like $_.DriveType -eq "SSD".

    Online Documentation - Cmdlet Reference - VMware {code}

    However, I think the information that you are looking for is the “ssd” property of the API object “Host.VmfsVolume”

    https://vdc-repo.vmware.com/vmwb-repository/dcr-public/fa5d1ee7-fad5-4ebf-b150-bdcef1d38d35/a5e46da1-9b96-4f0c-a1d0-7b8f…

    It is possible to “jump” from a powershell Datastore to an API datastore via “.extensiondata” property.

    For more details about the core concepts of PowerCLI:

    http://thecrazyconsultant.com/powercli-study-guide-core-concepts/

    (This guide is not up to date but the majority of concepts still apply today)

    Step 2: Try the function “Get-FileInDatastore” alone with only one datastore and your pattern

    Get-datastore “Datastorename” | Get-FileInDatastore –matchPattern “YourPattern”

    The goal is to check if the pattern is correct. (I am not sure if the pattern “*.vmx”| ogv" works.)

    Actually, the format expected for this “pattern” is not well documented in the API.

    https://code.vmware.com/doc/preview?id=4206#/doc/vim.host.DatastoreBrowser.SearchSpec.html

    Step 3: Try the function “get-FileInDatastoreWithWorkflow” alone

    Step 4: Try the function “Get-FilesIdentifiedAsAssociatedToAllVMs” alone

    Step 5: Try the function "get-ProbablyOrphanedFile"