VMware Cloud Community
jonathanp
Expert
Expert

How to get file permission. I.e: vmx, vmdk -- > rwxr-wr-w.. etc

Hi,

     I am doing a script tool and need to get some files permission... like all the permission for vmx, vmdk, vswp, etc...

Is there something there that I can do with powerCLI? Any help will be appreciated.

I found something like : Get-VM | Get-View | % { $_.Config.Files.VmPathName }

but this above just list the vmx file and without any permission information.

Regards

Jonathan

0 Kudos
3 Replies
LucD
Leadership
Leadership

Afaik, that is not possible with PowerCLI.

The SearchDatastoreSubFolders_Task method in the SDK can give you the file owner but that is all.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jonathanp
Expert
Expert

I can do that with TSM (SSH), and some kind of script...

But I have kind of an issue for ESXi... some host when I do "find /vmfs/volumes/ -name *.vmx"

On some host I get the file.. but on some other host it is kind of hanging there... like it can sit there for 30 mins and not giving any result.. have to close the ssh session.... and even looks like if I just go  inside the /vmfs/volumes... and do an ls... it is taking very long or does not give me anything...

is that a known issue or something that I missed somewhere?

Thanks

0 Kudos
LucD
Leadership
Leadership

Do you perhaps have one or more large NFS mounts defined as VMFS storage ?

I noticed that larger NFS mounts tend to be slow when recursively running through the directory structure.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos