Users started reporting they could not deploy VMs from templates. Upon inspecting the templates were showing 0MB disk files. When I checked the VM in vCenter I noticed it was not registered. I registered the VM and everything began working without issues. I now need to know the easiest way to search all datastores and folders in a vCenter to find all VMs that are not registered and to register them.
Have a look at VMX Raiders Revisited and Raiders of the Lost VMX
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That script could work, but it asks for too many values to be input. There are 100+ hosts, more than 500 datastores and a magnificent number of folders to transverse. Is there any way to change all of the values to just accept wildcards * ?
You can call the Register-VMX functio in a foreach loop.
Something like this for example
foreach($cluster in Get-Cluster){
Register-VMX -EntityName $cluster -WhatIf
}
Remove the WhatIf switch after you did a test run and are sure the script is doing what you want it to do.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference