VMware Cloud Community
NPBrown
Enthusiast
Enthusiast

How to get SrmFolder from MoRef using PowerShell & SRM API

I'm trying to list my Protection Groups which are nested in folders. I can get the parent folder MoRef easily enough:

$srmapi.Protection.ListProtectionGroups()[0].GetParentFolder().MoRef

But how can I get the SrmFolder object from the MoRef? I just need to get the folder name essentially.

Tags (2)
2 Replies
NPBrown
Enthusiast
Enthusiast

Bump

Can anyone help with this?

0 Kudos
iduevski
VMware Employee
VMware Employee

Hello,

In SRM API, ProtectionGroup.GetParentFolder() returns an object of type ProtectionGroupFolder which is a descendant class of Folder (SrmFolder). Instead of the MoRef, you should be able to access directly the Name property or GetName() method on this object.

Hope this applies to PowerShell extension as well. Please let me know if your issue with PowerShell can be resolved in this manner.

Regards,

Ivo