Hi everyone,
I am running the latest script in this thread: (I think ver 4): Find unregistered virtual machines
I want to run some metrics on the servers the script runs on. Essentially I want to add the resources these orphaned VM's take up in a csv file. The script needs to note down the size of the folder where the VMX is found. I'm not sure how to do that with this script.
Any help is appreciated!
Thanks,
Mike
They are VMFS, as for the Itemtype I'm not too sure. The script says File under that category. PSISContainer is False
I'm at my wits end I'm afraid.
With the script you attached earlier, the script works perfectly for me.
I would need to do e debugging sessions to analyse where the issue is located.
But since I can't seem to replicate the issue you are having, that will be difficult
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Can you send the script you are using? Maybe I'm still adding something wrong. I'll try to see if I can find anything.
Thanks a lot for your help regardless!
That seems to indicate that one of the datastores can not be found?!?
The script tries to obtain the datastore from the path to the VMX file.
For example, for "[DS1] TestVM/TestVM.vmx", the datastorename would be DS1.
Are there any VMX files in the resulting CSV, that have a datastore in the path that can not be retrieved with Get-Datastore?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I can't check all vmx files, however they are in the proper datastore. I'm able to retrieve all the datastores and trace the vmx files using the path. It's accurate.
I added some debugging lines in the 2nd part of the script (attached).
What does this show (i don't need all the output, just some representative loops through the 2nd part of the script).
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That seems to indicate that your copy of the script had an issue.
You can remove the Write-Host lines from the 2nd part of the script, and export the $newReport array to a CSV file.
Then it should be working.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I think I know what the problem is, your VM files are 2 levels deep, instead of the regular 1 level.
These are apparently all VMs created with LabManager.
Is that correct?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok, try running with this updated version.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It worked! I'm going to try and get the folder values in GB.
Thanks so much LucD!