We can easily gather all Managed Object information using vSphere SDK. We have seen in the earlier post about How to connect using SDK. Now, we will see how you can gather the Managed Object information using SDK. Once, we connect to vCenter, we will have an object called VMware.Vim.VimClientImpl and after connection, this object will help us to gather any Managed Object information. VimClientImpl object has the method FindEntityViews that can be used to get any Managed Object from…
We can connect vCenter using VMware.Vim dll file in c# code easily. This file does exist in the PowerCLI folder in Windows. Using this connection, we can achieve almost all the tasks that we can perform using Web Client or vSphere Client. Please refer other posts to understand how we can perform tasks or gather inventory.
static void Main(string args)
VMware.Vim.VimClientImpl client = new VimClientImpl();
ServiceContent sc = client.Connect("https://vCenterFqdn/sdk");
UserSession us = client.Login("user@domain", "password");