KB: Automate the adding / removing / updating of a VMware connection (deprecated)
Automate VMware connection using PowerShell
In some situations you may need to manage many vCenter or Esx Hosts connections. Ordinarily you would use the "Opslogix VMware Configuration Dashboard" for adding and removing connections, however this can be very time consuming using the GUI.
By using the script below you can add and remove connections by making use of a PowerShell script. All examples are based on modifying 1 connection. But you can easily change the script to handle multiple connections if needed.
Notice: This post is outdated . Since V20.11.x.x we have shiped a Powershell module to manage connection. Please see here for the updated version:
Example script how to add a vCenter / Esx Host connection
|
## ====================================================================== ## create discovery handler ## ================== |
Example script how to change a vCenter / Esx Host connection
|
## ====================================================================== ## login to the MS group ## =========================================================== ## ================== |
Example script how to remove a vCenter / Esx connection
|
## ====================================================================== ## =========================================================== $Class = Get-SCOMClass -Name OpsLogix.IMP.VMWare.vCenter |