"'Get-ContentLibrary' Could Error: 'Permission to Perform This Operation Was Denied'"
search cancel

"'Get-ContentLibrary' Could Error: 'Permission to Perform This Operation Was Denied'"

book

Article ID: 375588

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Get-ContentLibrary cmdlet retrieves content libraries and returns a set of content libraries that correspond to the filter criteria defined by the cmdlet parameters.

PS C:\Users\Username>  Get-ContentLibrary         An error occurred while trying to get content libraries by names: Permission to perform this operation was denied

Invoking this method may result in an error if user permissions are not defined.

Environment

  • VMware vCenter Server 7.x.
  • VMware vCenter Server 8.x.

Cause

A permission denied error occurs when user permissions are not defined in vCenter.

Resolution

Apply Content Library permissions to the user.

  • Log in to vCenter
  • Select Administration
  • Select Global Permissions
  • Add the User (Search relevant domain) with Role 'Content library administrator (sample)'
  • Check 'Propagate to children.'
  • Re-run the PowerCLI method 'Get-ContentLibrary.'

Additional Information

Content Library Privileges

https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-security-8-0.html


Content Libraries provide simple and effective management for virtual machine templates and vApps. Content library privileges control who can view or manage different aspects of content libraries.

To assign a permission to a content library, an Administrator must grant the permission to the user as a global permission. Global permissions support assigning privileges across solutions from a global root object.