Hi
I have come across the following error when using both EcoShell and PowerGUI when trying to list Files from either a vSphere Host or vCenter server.
ERROR: Exception Calling "SearchDatastore" with "2" argument(s): "Not initialised: boolean fileOwner"
I am sure that this worked fine with ESX 3.5 and Virtual Centre 2.5, listing all files related to VMs hosted by that Virtual Centre server.
Any ideas?
Thanks
Ossie
You can try the solution Yasen provided earlier today in .
That way the script will work in VI and vSphere.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You're right, this worked in VC 2.5.
The reason is that a new property was added to one of the objects in vSphere.
See also my last reply in .
Unfortunately I don't have access to a vSphere test environment right now, will try it out later today.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I've also answered this in the VESI forums for you, but here is what I posted so others can see this as well:
It appears as if the vSphere SDK introduced a new property to the FileQueryFlags SearchSpec, and that it is also required. To fix this directly in the script, it will likely break file search against VI3. If you are only vSphere, this will work for you.
After BOTH lines 28 and 34 in the "Files" node in the main tree, add the following lines:
After 28:
$folderSearchSpecification.details.fileOwner = $true
After 34:
$fileSearchSpecification.details.fileOwner = $true
In order to properly determine the difference between VI3 and vSphere, there would be additional logic, and I will submit a bugfix for a future release. If you do still manage VI3 and vSphere environments, you could copy the code in the node and simply create a new node labled "Files - vSphere" that has the proper modifications. Not optimal, but will work while Dev provides additional logic for the required flag.
Scott
Scott, it's not only the missing property that is causing the problem in vSphere.
Even when the property is initialised the method still fails with the same error.
There are several other threads that report the same problem
Perhaps Carter should have a look and give some feedback.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
See for a vSphere bypass.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Scott and LucD. I will give your suggestions a try this evening and see how it goes. Much appreciated.
Ossie
Hi Scott
As mentioned by LucD the addition of these two flags did not resolve the issue.... sadly.
Thanks
Ossie
You can try the solution Yasen provided earlier today in .
That way the script will work in VI and vSphere.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD
Thanks, tried the suggestion at that post and this worked fine, at least for vCentre Server
Cheers
Ossie.
I have tried the workaround proposed and it doesn't seem to pick up any files.
**Disreguard, think I figured this out.