.NET Example of Retrieving a List of All Content Libraries

This example shows how you can retrieve a list of all local and subscribed content libraries in your virtual environment.
This example uses the steps that are described in Listing All Content Libraries.
For related code samples, see the vSphere Automation SDK .NET samples at GitHub.
... // Create a vSphere Automation session (not shown). // Access the Library Service. var libraryService = ServiceManager.VapiConnection.GetService<Library>(); // List the visible content libraries. Console.WriteLine("List of all library identifiers: "); foreach (var libId in libraryService.List()) { Console.WriteLine(libId); }